forked from dylex/slack-libpurple
-
Notifications
You must be signed in to change notification settings - Fork 2
/
slack-user.h
43 lines (31 loc) · 1.14 KB
/
slack-user.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _PURPLE_SLACK_USER_H
#define _PURPLE_SLACK_USER_H
#include "json.h"
#include "slack-object.h"
#include "slack.h"
/* SlackUser represents both a user object, and an optional im object */
struct _SlackUser {
SlackObject object;
char *status;
char *avatar_hash;
char *avatar_url;
/* when there is an open IM channel: */
slack_object_id im; /* in ims */
};
#define SLACK_TYPE_USER slack_user_get_type()
G_DECLARE_FINAL_TYPE(SlackUser, slack_user, SLACK, USER, SlackObject)
static inline PurpleBuddy *user_buddy(SlackUser *user) {
return PURPLE_BUDDY(user->object.buddy);
}
/* Initialization */
void slack_users_load(SlackAccount *sa);
SlackUser *slack_user_update(SlackAccount *sa, json_value *json);
/* RTM event handlers */
void slack_user_changed(SlackAccount *sa, json_value *json);
void slack_presence_change(SlackAccount *sa, json_value *json);
/* Purple protocol handlers */
void slack_set_info(PurpleConnection *gc, const char *info);
char *slack_status_text(PurpleBuddy *buddy);
void slack_get_info(PurpleConnection *gc, const char *who);
void slack_update_avatar(SlackAccount *sa, SlackUser *user);
#endif // _PURPLE_SLACK_USER_H