libpurple/protocols.c

changeset 41995
df50021edabd
parent 41963
d140e4f6bb02
child 42009
fb172b78a9ee
equal deleted inserted replaced
41994:c13754d0bd3d 41995:df50021edabd
40 40
41 /**************************************************************************/ 41 /**************************************************************************/
42 /* Protocol API */ 42 /* Protocol API */
43 /**************************************************************************/ 43 /**************************************************************************/
44 void 44 void
45 purple_protocol_got_account_idle(PurpleAccount *account, gboolean idle,
46 time_t idle_time)
47 {
48 g_return_if_fail(account != NULL);
49 g_return_if_fail(purple_account_is_connected(account));
50
51 purple_presence_set_idle(purple_account_get_presence(account),
52 idle, idle_time);
53 }
54
55 void
56 purple_protocol_got_account_status_with_attributes(PurpleAccount *account,
57 const gchar *status_id,
58 GHashTable *attributes)
59 {
60 PurplePresence *presence;
61 PurpleStatus *status;
62
63 g_return_if_fail(account != NULL);
64 g_return_if_fail(status_id != NULL);
65 g_return_if_fail(purple_account_is_connected(account));
66
67 presence = purple_account_get_presence(account);
68 status = purple_presence_get_status(presence, status_id);
69
70 g_return_if_fail(status != NULL);
71
72 purple_status_set_active_with_attributes(status, TRUE, attributes);
73 }
74
75 void
76 purple_protocol_got_account_status(PurpleAccount *account, const char *status_id, ...)
77 {
78 GHashTable *attributes = NULL;
79 va_list args;
80
81 va_start(args, status_id);
82 attributes = purple_attrs_from_vargs(args);
83 va_end(args);
84
85 purple_protocol_got_account_status_with_attributes(account, status_id,
86 attributes);
87
88 g_hash_table_destroy(attributes);
89 }
90
91 void
92 purple_protocol_got_account_actions(PurpleAccount *account) 45 purple_protocol_got_account_actions(PurpleAccount *account)
93 { 46 {
94 47
95 g_return_if_fail(account != NULL); 48 g_return_if_fail(account != NULL);
96 g_return_if_fail(purple_account_is_connected(account)); 49 g_return_if_fail(purple_account_is_connected(account));

mercurial