Mercurial > pidgin
annotate plugins/perl/common/BuddyList.xs @ 13219:d0f7f698b6de
[gaim-migrate @ 15583]
SF Patch #1428591 from Sadrul
"This is a new signal, emitted when request for a
file-transfer comes in. I have written a trivial plugin
(which I plan on adding under plugin_pack in a couple
of days) that uses this signal to auto-accept
file-transfers. I have tested the plugin to auto-accept
or auto-reject file-transfer requests."
I also noticed that the file transfer signals weren't using a subtype for
GaimXfer pointers, so I added one.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 11 Feb 2006 05:24:30 +0000 |
parents | 248b8b39c671 |
children |
rev | line source |
---|---|
6531 | 1 #include "module.h" |
11118 | 2 #include "../perl-handlers.h" |
3 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
4 MODULE = Gaim::BuddyList PACKAGE = Gaim PREFIX = gaim_ |
11118 | 5 PROTOTYPES: ENABLE |
6 | |
7 Gaim::BuddyList | |
8 gaim_get_blist() | |
9 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
10 void |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
11 gaim_set_blist(blist) |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
12 Gaim::BuddyList blist |
11118 | 13 |
14 MODULE = Gaim::BuddyList PACKAGE = Gaim::Find PREFIX = gaim_find_ | |
15 PROTOTYPES: ENABLE | |
16 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
17 Gaim::BuddyList::Buddy |
11118 | 18 gaim_find_buddy(account, name) |
19 Gaim::Account account | |
20 const char * name | |
21 | |
22 void | |
23 gaim_find_buddies(account, name) | |
24 Gaim::Account account | |
25 const char * name | |
26 PREINIT: | |
27 GSList *l; | |
28 PPCODE: | |
29 for (l = gaim_find_buddies(account, name); l != NULL; l = l->next) { | |
30 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::BuddyList::Buddy"))); | |
31 } | |
32 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
33 gboolean |
11118 | 34 gaim_group_on_account(group, account) |
35 Gaim::BuddyList::Group group | |
36 Gaim::Account account | |
37 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
38 Gaim::BuddyList::Group |
11118 | 39 gaim_find_group(name) |
40 const char *name | |
41 | |
12819
622110272ed9
[gaim-migrate @ 15167]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12789
diff
changeset
|
42 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList::Contact PREFIX = gaim_contact_ |
11118 | 43 PROTOTYPES: ENABLE |
44 | |
45 Gaim::BuddyList::Contact | |
46 gaim_contact_new(); | |
47 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
48 Gaim::BuddyList::Buddy |
11118 | 49 gaim_contact_get_priority_buddy(contact) |
50 Gaim::BuddyList::Contact contact | |
51 | |
52 void | |
53 gaim_contact_set_alias(contact, alias) | |
54 Gaim::BuddyList::Contact contact | |
55 const char * alias | |
56 | |
57 const char * | |
58 gaim_contact_get_alias(contact) | |
59 Gaim::BuddyList::Contact contact | |
60 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
61 gboolean |
11118 | 62 gaim_contact_on_account(contact, account) |
63 Gaim::BuddyList::Contact contact | |
64 Gaim::Account account | |
65 | |
66 void | |
67 gaim_contact_invalidate_priority_buddy(contact) | |
68 Gaim::BuddyList::Contact contact | |
69 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
70 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_ |
11118 | 71 PROTOTYPES: ENABLE |
72 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
73 Gaim::BuddyList::Group |
11118 | 74 gaim_group_new(name) |
75 const char *name | |
76 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
77 void |
11118 | 78 gaim_group_get_accounts(group) |
79 Gaim::BuddyList::Group group | |
80 PREINIT: | |
81 GSList *l; | |
82 PPCODE: | |
83 for (l = gaim_group_get_accounts(group); l != NULL; l = l->next) { | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
84 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); |
11118 | 85 } |
86 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
87 gboolean |
11118 | 88 gaim_group_on_account(group, account) |
89 Gaim::BuddyList::Group group | |
90 Gaim::Account account | |
91 | |
6531 | 92 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList PREFIX = gaim_blist_ |
93 PROTOTYPES: ENABLE | |
94 | |
95 void | |
11118 | 96 gaim_blist_add_contact(contact, group, node) |
97 Gaim::BuddyList::Contact contact | |
98 Gaim::BuddyList::Group group | |
99 Gaim::BuddyList::Node node | |
100 | |
101 void | |
102 gaim_blist_merge_contact(source, node) | |
103 Gaim::BuddyList::Contact source | |
104 Gaim::BuddyList::Node node | |
6531 | 105 |
106 void | |
11118 | 107 gaim_blist_add_group(group, node) |
108 Gaim::BuddyList::Group group | |
109 Gaim::BuddyList::Node node | |
6531 | 110 |
111 void | |
11118 | 112 gaim_blist_add_buddy(buddy, contact, group, node) |
113 Gaim::BuddyList::Buddy buddy | |
114 Gaim::BuddyList::Contact contact | |
115 Gaim::BuddyList::Group group | |
116 Gaim::BuddyList::Node node | |
6531 | 117 |
118 void | |
119 gaim_blist_remove_buddy(buddy) | |
120 Gaim::BuddyList::Buddy buddy | |
121 | |
122 void | |
11118 | 123 gaim_blist_remove_contact(contact) |
124 Gaim::BuddyList::Contact contact | |
6531 | 125 |
126 void | |
127 gaim_blist_remove_chat(chat) | |
128 Gaim::BuddyList::Chat chat | |
129 | |
130 void | |
11118 | 131 gaim_blist_remove_group(group) |
132 Gaim::BuddyList::Group group | |
6531 | 133 |
134 Gaim::BuddyList::Chat | |
135 gaim_blist_find_chat(account, name) | |
136 Gaim::Account account | |
137 const char *name | |
138 | |
6540
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
139 void |
11118 | 140 gaim_blist_add_chat(chat, group, node) |
141 Gaim::BuddyList::Chat chat | |
142 Gaim::BuddyList::Group group | |
143 Gaim::BuddyList::Node node | |
144 | |
145 Gaim::BuddyList | |
146 gaim_blist_new() | |
147 | |
148 void | |
149 gaim_blist_show() | |
150 | |
151 void | |
152 gaim_blist_destroy(); | |
153 | |
154 void | |
155 gaim_blist_set_visible(show) | |
156 gboolean show | |
157 | |
158 void | |
159 gaim_blist_update_buddy_status(buddy, old_status) | |
160 Gaim::BuddyList::Buddy buddy | |
161 Gaim::Status old_status | |
162 | |
163 void | |
164 gaim_blist_update_buddy_icon(buddy) | |
165 Gaim::BuddyList::Buddy buddy | |
166 | |
167 void | |
168 gaim_blist_rename_buddy(buddy, name) | |
169 Gaim::BuddyList::Buddy buddy | |
170 const char * name | |
171 | |
172 void | |
173 gaim_blist_alias_buddy(buddy, alias) | |
174 Gaim::BuddyList::Buddy buddy | |
175 const char * alias | |
176 | |
177 void | |
178 gaim_blist_server_alias_buddy(buddy, alias) | |
179 Gaim::BuddyList::Buddy buddy | |
180 const char * alias | |
181 | |
182 void | |
183 gaim_blist_alias_chat(chat, alias) | |
184 Gaim::BuddyList::Chat chat | |
185 const char * alias | |
186 | |
187 void | |
188 gaim_blist_rename_group(group, name) | |
189 Gaim::BuddyList::Group group | |
190 const char * name | |
191 | |
192 void | |
193 gaim_blist_add_account(account) | |
194 Gaim::Account account | |
195 | |
196 void | |
197 gaim_blist_remove_account(account) | |
198 Gaim::Account account | |
199 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
200 int |
11118 | 201 gaim_blist_get_group_size(group, offline) |
202 Gaim::BuddyList::Group group | |
203 gboolean offline | |
204 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
205 int |
11118 | 206 gaim_blist_get_group_online_count(group) |
207 Gaim::BuddyList::Group group | |
208 | |
209 void | |
210 gaim_blist_load() | |
211 | |
212 void | |
213 gaim_blist_schedule_save() | |
214 | |
215 void | |
216 gaim_blist_request_add_group() | |
217 | |
218 void | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
219 gaim_blist_node_get_extended_menu(node) |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
220 Gaim::BuddyList::Node node |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
221 PREINIT: |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
222 GList *l; |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
223 PPCODE: |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
224 for (l = gaim_blist_node_get_extended_menu(node); l != NULL; l = l->next) { |
12919
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12866
diff
changeset
|
225 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Menu::Action"))); |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
226 } |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
227 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
228 void |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
229 gaim_blist_set_ui_ops(ops) |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
230 Gaim::BuddyList::UiOps ops |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
231 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
232 Gaim::BuddyList::UiOps |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
233 gaim_blist_get_ui_ops() |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
234 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
235 void * |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
236 gaim_blist_get_handle() |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
237 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
238 void |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
239 gaim_blist_init() |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
240 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
241 void |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
242 gaim_blist_uninit() |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
243 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
244 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList::Node PREFIX = gaim_blist_node_ |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
245 PROTOTYPES: ENABLE |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
246 |
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
247 void |
11118 | 248 gaim_blist_node_set_bool(node, key, value) |
249 Gaim::BuddyList::Node node | |
250 const char * key | |
251 gboolean value | |
252 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
253 gboolean |
11118 | 254 gaim_blist_node_get_bool(node, key) |
255 Gaim::BuddyList::Node node | |
256 const char * key | |
257 | |
258 void | |
259 gaim_blist_node_set_int(node, key, value) | |
260 Gaim::BuddyList::Node node | |
261 const char * key | |
262 int value | |
263 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
264 int |
11118 | 265 gaim_blist_node_get_int(node, key) |
266 Gaim::BuddyList::Node node | |
267 const char * key | |
268 | |
269 const char * | |
270 gaim_blist_node_get_string(node, key) | |
271 Gaim::BuddyList::Node node | |
272 const char * key | |
273 | |
274 void | |
275 gaim_blist_node_remove_setting(node, key) | |
276 Gaim::BuddyList::Node node | |
277 const char * key | |
278 | |
279 void | |
280 gaim_blist_node_set_flags(node, flags) | |
281 Gaim::BuddyList::Node node | |
12866
43d8af815a9d
[gaim-migrate @ 15217]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12820
diff
changeset
|
282 Gaim::BuddyList::NodeFlags flags |
11118 | 283 |
12866
43d8af815a9d
[gaim-migrate @ 15217]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12820
diff
changeset
|
284 Gaim::BuddyList::NodeFlags |
11118 | 285 gaim_blist_node_get_flags(node) |
286 Gaim::BuddyList::Node node | |
287 | |
12820
cb3cbd69284d
[gaim-migrate @ 15168]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12819
diff
changeset
|
288 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList::Chat PREFIX = gaim_chat_ |
11118 | 289 PROTOTYPES: ENABLE |
290 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
291 Gaim::BuddyList::Group |
11118 | 292 gaim_chat_get_group(chat) |
293 Gaim::BuddyList::Chat chat | |
294 | |
295 const char * | |
296 gaim_chat_get_name(chat) | |
297 Gaim::BuddyList::Chat chat | |
298 | |
299 Gaim::BuddyList::Chat | |
300 gaim_chat_new(account, alias, components) | |
301 Gaim::Account account | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
302 const char * alias |
11118 | 303 SV * components |
304 INIT: | |
305 HV * t_HV; | |
306 HE * t_HE; | |
307 SV * t_SV; | |
308 GHashTable * t_GHash; | |
309 I32 len; | |
310 char *t_key, *t_value; | |
311 CODE: | |
312 t_HV = (HV *)SvRV(components); | |
313 t_GHash = g_hash_table_new(NULL, NULL); | |
314 | |
315 for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { | |
316 t_key = hv_iterkey(t_HE, &len); | |
317 t_SV = *hv_fetch(t_HV, t_key, len, 0); | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
318 t_value = SvPV(t_SV, PL_na); |
11118 | 319 |
320 g_hash_table_insert(t_GHash, t_key, t_value); | |
6540
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
321 } |
6545
5a3fbef32910
[gaim-migrate @ 7067]
Christian Hammond <chipx86@chipx86.com>
parents:
6544
diff
changeset
|
322 |
11118 | 323 RETVAL = gaim_chat_new(account, alias, t_GHash); |
6545
5a3fbef32910
[gaim-migrate @ 7067]
Christian Hammond <chipx86@chipx86.com>
parents:
6544
diff
changeset
|
324 OUTPUT: |
5a3fbef32910
[gaim-migrate @ 7067]
Christian Hammond <chipx86@chipx86.com>
parents:
6544
diff
changeset
|
325 RETVAL |
11118 | 326 |
12820
cb3cbd69284d
[gaim-migrate @ 15168]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12819
diff
changeset
|
327 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList::Buddy PREFIX = gaim_buddy_ |
11118 | 328 PROTOTYPES: ENABLE |
329 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
330 Gaim::BuddyList::Buddy |
11118 | 331 gaim_buddy_new(account, screenname, alias) |
332 Gaim::Account account | |
333 const char *screenname | |
334 const char *alias | |
335 | |
336 void | |
337 gaim_buddy_set_icon(buddy, icon) | |
338 Gaim::BuddyList::Buddy buddy | |
339 Gaim::Buddy::Icon icon | |
340 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
341 Gaim::Account |
11118 | 342 gaim_buddy_get_account(buddy) |
343 Gaim::BuddyList::Buddy buddy | |
344 | |
12088 | 345 Gaim::BuddyList::Group |
346 gaim_buddy_get_group(buddy) | |
347 Gaim::BuddyList::Buddy buddy | |
348 | |
11118 | 349 const char * |
350 gaim_buddy_get_name(buddy) | |
351 Gaim::BuddyList::Buddy buddy | |
352 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
353 Gaim::Buddy::Icon |
11118 | 354 gaim_buddy_get_icon(buddy) |
355 Gaim::BuddyList::Buddy buddy | |
356 | |
357 Gaim::BuddyList::Contact | |
358 gaim_buddy_get_contact(buddy) | |
359 Gaim::BuddyList::Buddy buddy | |
360 | |
12786
33ddb29406a1
[gaim-migrate @ 15133]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12088
diff
changeset
|
361 Gaim::Presence |
11118 | 362 gaim_buddy_get_presence(buddy) |
363 Gaim::BuddyList::Buddy buddy | |
364 | |
365 const char * | |
366 gaim_buddy_get_alias_only(buddy) | |
367 Gaim::BuddyList::Buddy buddy | |
368 | |
369 const char * | |
370 gaim_buddy_get_contact_alias(buddy) | |
371 Gaim::BuddyList::Buddy buddy | |
372 | |
373 const char * | |
374 gaim_buddy_get_local_alias(buddy) | |
375 Gaim::BuddyList::Buddy buddy | |
376 | |
377 const char * | |
378 gaim_buddy_get_alias(buddy) | |
379 Gaim::BuddyList::Buddy buddy |