revamp handling of channels

This commit is contained in:
2019-07-10 20:16:47 +02:00
parent 596969bbae
commit 6d7c7e641f
11 changed files with 151 additions and 42 deletions

View File

@@ -56,12 +56,30 @@ dc_account_t dc_session_me(dc_session_t s);
* access to the internal account cache
*/
void dc_session_add_account(dc_session_t s, dc_account_t u);
dc_account_t dc_session_account_fullname(dc_session_t s, char const *f);
/**
* access to the internal channel cache
* Adds a new channel to the internal cache.
*/
void dc_session_add_channel(dc_session_t s, dc_channel_t u);
/**
* Creates a new channel, or returns an existing channel if a channel with
* these recipients already exists.
* Warning: You must dc_ref() the return object if you need it beyond the
* life-span of the session.
*/
dc_channel_t dc_session_make_channel(dc_session_t s, dc_account_t *r,
size_t n);
/**
* Finds a channel object by that match the given recipients.
* Warning: You must dc_ref() the return object if you need it beyond the
* life-span of the session.
*/
dc_channel_t dc_session_channel_recipients(dc_session_t s,
dc_account_t *r, size_t sz);
/**
* comparision functions for sorting, and finding
*/