Mercurial > pidgin
comparison libpurple/pounce.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | 609e3855f36d |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
30 | 30 |
31 #include "debug.h" | 31 #include "debug.h" |
32 #include "pounce.h" | 32 #include "pounce.h" |
33 #include "util.h" | 33 #include "util.h" |
34 | 34 |
35 /** | |
36 * A buddy pounce structure. | |
37 * | |
38 * Buddy pounces are actions triggered by a buddy-related event. For | |
39 * example, a sound can be played or an IM window opened when a buddy | |
40 * signs on or returns from away. Such responses are handled in the | |
41 * UI. The events themselves are done in the core. | |
42 */ | |
43 struct _PurplePounce | |
44 { | |
45 char *ui_type; /**< The type of UI. */ | |
46 | |
47 PurplePounceEvent events; /**< The event(s) to pounce on. */ | |
48 PurplePounceOption options; /**< The pounce options */ | |
49 PurpleAccount *pouncer; /**< The user who is pouncing. */ | |
50 | |
51 char *pouncee; /**< The buddy to pounce on. */ | |
52 | |
53 GHashTable *actions; /**< The registered actions. */ | |
54 | |
55 gboolean save; /**< Whether or not the pounce should | |
56 be saved after activation. */ | |
57 void *data; /**< Pounce-specific data. */ | |
58 }; | |
59 | |
35 typedef struct | 60 typedef struct |
36 { | 61 { |
37 GString *buffer; | 62 GString *buffer; |
38 | 63 |
39 PurplePounce *pounce; | 64 PurplePounce *pounce; |
178 | 203 |
179 node = xmlnode_new("pounce"); | 204 node = xmlnode_new("pounce"); |
180 xmlnode_set_attrib(node, "ui", pounce->ui_type); | 205 xmlnode_set_attrib(node, "ui", pounce->ui_type); |
181 | 206 |
182 child = xmlnode_new_child(node, "account"); | 207 child = xmlnode_new_child(node, "account"); |
183 xmlnode_set_attrib(child, "protocol", pouncer->protocol_id); | 208 xmlnode_set_attrib(child, "protocol", purple_account_get_protocol_id(pouncer)); |
184 xmlnode_insert_data(child, | 209 xmlnode_insert_data(child, |
185 purple_normalize(pouncer, purple_account_get_username(pouncer)), -1); | 210 purple_normalize(pouncer, purple_account_get_username(pouncer)), -1); |
186 | 211 |
187 child = xmlnode_new_child(node, "pouncee"); | 212 child = xmlnode_new_child(node, "pouncee"); |
188 xmlnode_insert_data(child, purple_pounce_get_pouncee(pounce), -1); | 213 xmlnode_insert_data(child, purple_pounce_get_pouncee(pounce), -1); |