implement message sending to channels

This commit is contained in:
2019-07-12 11:53:32 +02:00
parent 0c9432c269
commit b8fa202ce3
18 changed files with 219 additions and 28 deletions

View File

@@ -90,6 +90,12 @@ bool dc_api_create_channel(dc_api_t api, dc_account_t login,
*/
bool dc_api_get_messages(dc_api_t api, dc_account_t login, dc_channel_t c);
/**
* post a message to the given channel
*/
bool dc_api_post_message(dc_api_t api, dc_account_t login,
dc_channel_t c, dc_message_t m);
/**
* Fetch a list of friends of the login account "login". The friends are stored
* within the login object.

View File

@@ -10,6 +10,7 @@ struct dc_message_;
typedef struct dc_message_ *dc_message_t;
dc_message_t dc_message_new(void);
dc_message_t dc_message_new_content(char const *s, int len);
dc_message_t dc_message_from_json(json_t *j);
json_t *dc_message_to_json(dc_message_t m);

View File

@@ -52,6 +52,12 @@ bool dc_session_has_token(dc_session_t s);
*/
dc_account_t dc_session_me(dc_session_t s);
/**
* Return the API handle in use by the session. Do not unref the reference
* and if you need it for something else, dc_ref() it yourself.
*/
dc_api_t dc_session_api(dc_session_t s);
/**
* access to the internal account cache
*/