first channel API

This commit is contained in:
2019-07-05 13:37:50 +02:00
parent be4e5cedc3
commit e2bdd05775
3 changed files with 65 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
#include <dc/apisync.h>
#include <dc/account.h>
#include <dc/guild.h>
#include <dc/channel.h>
#include <stdbool.h>
@@ -59,6 +60,16 @@ bool dc_api_get_userinfo(dc_api_t api, dc_account_t login,
bool dc_api_get_userguilds(dc_api_t api, dc_account_t login,
GPtrArray **guilds);
/**
* Create a 1:1 or 1:N DM channel with the given recipients. The recipients must
* have their ID (snowflake) set. Returns the new channel, complete with ID, and
* all in "channel". Note that the "login" user is automatically added to the DM
* session, so it is not needed to add him to recipients.
*/
bool dc_api_create_channel(dc_api_t api, dc_account_t login,
dc_account_t *recipients, size_t nrecp,
dc_channel_t *channel);
/**
* Fetch a list of friends of the login account "login". The friends are stored
* within the login object.