implement adding friends

This commit is contained in:
2019-07-03 22:47:12 +02:00
parent 2e563b724a
commit efce6a6543
8 changed files with 231 additions and 68 deletions

View File

@@ -8,8 +8,19 @@
struct dc_account_;
typedef struct dc_account_ *dc_account_t;
typedef enum {
FRIEND_STATE_NONE = 0,
/* accountt is a mutual friend
*/
FRIEND_STATE_FRIEND = 1,
/* pending account, the other side hasn't accepted yet
*/
FRIEND_STATE_PENDING = 4,
} dc_account_friend_states;
dc_account_t dc_account_new(void);
dc_account_t dc_account_new2(char const *email, char const *pass);
dc_account_t dc_account_from_fullid(char const *fullid);
void dc_account_set_email(dc_account_t a, char const *email);
char const *dc_account_email(dc_account_t a);
@@ -37,5 +48,7 @@ bool dc_account_has_token(dc_account_t a);
void dc_account_set_friends(dc_account_t a, dc_account_t *ptr, size_t len);
dc_account_t dc_account_nthfriend(dc_account_t a, size_t i);
size_t dc_account_friends_size(dc_account_t a);
int dc_account_friend_state(dc_account_t a);
void dc_account_set_friend_state(dc_account_t a, int state);
#endif

View File

@@ -65,4 +65,9 @@ bool dc_api_get_userguilds(dc_api_t api, dc_account_t login,
*/
bool dc_api_get_friends(dc_api_t api, dc_account_t login);
/**
* Add a given account as a friend to the friends list
*/
bool dc_api_add_friend(dc_api_t api, dc_account_t login, dc_account_t friend);
#endif