Mercurial > pidgin
annotate plugins/signals-test.c @ 9948:b13013595c08
[gaim-migrate @ 10844]
"This disables the default action and focus for certain dialogs which use
gaim_request_action such as the file transfer dialog ('do you wish to
receive this file'). Note that this will require the user to either click
the button of their choice or tab to the button of choice and press enter
or space.
Should fix Bug #1020523
I'll submit another patch to clean up the rest of the dialogs once I hear
back from the rest of the team as to how the desired behavior should be.
--dw
"
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 04 Sep 2004 03:33:16 +0000 |
parents | 5e1c76f3d232 |
children | a9fb4493ae22 |
rev | line source |
---|---|
6485 | 1 /* |
2 * Signals test plugin. | |
3 * | |
4 * Copyright (C) 2003 Christian Hammond. | |
5 * | |
6 * This program is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation; either version 2 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, but | |
12 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
19 * 02111-1307, USA. | |
20 */ | |
21 #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" | |
22 | |
23 #include <stdio.h> | |
24 | |
25 #include "internal.h" | |
26 #include "connection.h" | |
27 #include "conversation.h" | |
28 #include "core.h" | |
29 #include "debug.h" | |
30 #include "signals.h" | |
31 | |
32 /************************************************************************** | |
33 * Account subsystem signal callbacks | |
34 **************************************************************************/ | |
35 static void | |
36 account_connecting_cb(GaimAccount *account, void *data) | |
37 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
38 gaim_debug_misc("signals test", "account-connecting (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
39 gaim_account_get_username(account)); |
6485 | 40 } |
41 | |
42 static void | |
43 account_away_cb(GaimAccount *account, const char *state, | |
44 const char *message, void *data) | |
45 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
46 gaim_debug_misc("signals test", "account-away (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
47 gaim_account_get_username(account), state, message); |
6485 | 48 } |
49 | |
50 static void | |
51 account_setting_info_cb(GaimAccount *account, const char *info, void *data) | |
52 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
53 gaim_debug_misc("signals test", "account-setting-info (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
54 gaim_account_get_username(account), info); |
6485 | 55 } |
56 | |
57 static void | |
58 account_set_info_cb(GaimAccount *account, const char *info, void *data) | |
59 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
60 gaim_debug_misc("signals test", "account-set-info (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
61 gaim_account_get_username(account), info); |
6485 | 62 } |
63 | |
64 static void | |
65 account_warned_cb(GaimAccount *account, const char *warner, int level, | |
66 void *data) | |
67 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
68 gaim_debug_misc("signals test", "account-warned (%s, %s, %d)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
69 gaim_account_get_username(account), warner, level); |
6485 | 70 } |
71 | |
72 /************************************************************************** | |
73 * Buddy List subsystem signal callbacks | |
74 **************************************************************************/ | |
75 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
76 buddy_away_cb(GaimBuddy *buddy, void *data) |
6485 | 77 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
78 gaim_debug_misc("signals test", "buddy-away (%s)\n", buddy->name); |
6485 | 79 } |
80 | |
81 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
82 buddy_back_cb(GaimBuddy *buddy, void *data) |
6485 | 83 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
84 gaim_debug_misc("signals test", "buddy-back (%s)\n", buddy->name); |
6485 | 85 } |
86 | |
87 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
88 buddy_idle_cb(GaimBuddy *buddy, void *data) |
6485 | 89 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
90 gaim_debug_misc("signals test", "buddy-idle (%s)\n", buddy->name); |
6485 | 91 } |
92 | |
93 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
94 buddy_unidle_cb(GaimBuddy *buddy, void *data) |
6485 | 95 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
96 gaim_debug_misc("signals test", "buddy-unidle (%s)\n", buddy->name); |
6485 | 97 } |
98 | |
99 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
100 buddy_signed_on_cb(GaimBuddy *buddy, void *data) |
6485 | 101 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
102 gaim_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); |
6485 | 103 } |
104 | |
105 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
106 buddy_signed_off_cb(GaimBuddy *buddy, void *data) |
6485 | 107 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
108 gaim_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); |
6485 | 109 } |
110 | |
8999 | 111 static void |
9051 | 112 blist_node_extended_menu_cb(GaimBlistNode *node, void *data) |
8999 | 113 { |
9051 | 114 GaimContact *p = (GaimContact *)node; |
115 GaimBuddy *b = (GaimBuddy *)node; | |
116 GaimChat *c = (GaimChat *)node; | |
117 GaimGroup *g = (GaimGroup *)node; | |
8999 | 118 |
9051 | 119 if (GAIM_BLIST_NODE_IS_CONTACT(node)) |
120 gaim_debug_misc("signals test", "blist-node-extended-menu (Contact: %s)\n", p->alias); | |
121 else if (GAIM_BLIST_NODE_IS_BUDDY(node)) | |
122 gaim_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s)\n", b->name); | |
123 else if (GAIM_BLIST_NODE_IS_CHAT(node)) | |
124 gaim_debug_misc("signals test", "blist-node-extended-menu (Chat: %s)\n", c->alias); | |
125 else if (GAIM_BLIST_NODE_IS_GROUP(node)) | |
126 gaim_debug_misc("signals test", "blist-node-extended-menu (Group: %s)\n", g->name); | |
127 else | |
128 gaim_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d)\n", node->type); | |
129 | |
8999 | 130 } |
131 | |
132 | |
6485 | 133 /************************************************************************** |
134 * Connection subsystem signal callbacks | |
135 **************************************************************************/ | |
136 static void | |
137 signing_on_cb(GaimConnection *gc, void *data) | |
138 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
139 gaim_debug_misc("signals test", "signing-on (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
140 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 141 } |
142 | |
143 static void | |
144 signed_on_cb(GaimConnection *gc, void *data) | |
145 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
146 gaim_debug_misc("signals test", "signed-on (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
147 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 148 } |
149 | |
150 static void | |
151 signing_off_cb(GaimConnection *gc, void *data) | |
152 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
153 gaim_debug_misc("signals test", "signing-off (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
154 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 155 } |
156 | |
157 static void | |
158 signed_off_cb(GaimConnection *gc, void *data) | |
159 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
160 gaim_debug_misc("signals test", "signed-off (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
161 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 162 } |
163 | |
164 /************************************************************************** | |
165 * Conversation subsystem signal callbacks | |
166 **************************************************************************/ | |
167 static gboolean | |
7503 | 168 displaying_im_msg_cb(GaimAccount *account, GaimConversation *conv, |
169 char **buffer, void *data) | |
6485 | 170 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
171 gaim_debug_misc("signals test", "displaying-im-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
172 gaim_conversation_get_name(conv), *buffer); |
6485 | 173 |
174 return FALSE; | |
175 } | |
176 | |
177 static void | |
9051 | 178 displayed_im_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) |
6485 | 179 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
180 gaim_debug_misc("signals test", "displayed-im-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
181 gaim_conversation_get_name(conv), buffer); |
6485 | 182 } |
183 | |
9051 | 184 static gboolean |
185 writing_im_msg_cb(GaimAccount *account, GaimConversation *conv, char **buffer, void *data) | |
186 { | |
187 gaim_debug_misc("signals test", "writing-im-msg (%s, %s, %s)\n", | |
188 gaim_account_get_username(account), gaim_conversation_get_name(conv), *buffer); | |
189 | |
190 return FALSE; | |
191 | |
192 } | |
193 | |
194 static void | |
195 wrote_im_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) | |
196 { | |
197 gaim_debug_misc("signals test", "wrote-im-msg (%s, %s, %s)\n", | |
198 gaim_account_get_username(account), gaim_conversation_get_name(conv), buffer); | |
199 } | |
200 | |
7503 | 201 static void |
6509 | 202 sending_im_msg_cb(GaimAccount *account, char *recipient, char **buffer, void *data) |
6485 | 203 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
204 gaim_debug_misc("signals test", "sending-im-msg (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
205 gaim_account_get_username(account), recipient, *buffer); |
6485 | 206 |
207 } | |
208 | |
209 static void | |
6509 | 210 sent_im_msg_cb(GaimAccount *account, const char *recipient, const char *buffer, void *data) |
6485 | 211 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
212 gaim_debug_misc("signals test", "sent-im-msg (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
213 gaim_account_get_username(account), recipient, buffer); |
6485 | 214 } |
215 | |
216 static gboolean | |
8999 | 217 receiving_im_msg_cb(GaimAccount *account, char **sender, char **buffer, |
6509 | 218 int *flags, void *data) |
6485 | 219 { |
8999 | 220 gaim_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %d)\n", |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
221 gaim_account_get_username(account), *sender, *buffer, |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
222 *flags); |
6485 | 223 |
224 return FALSE; | |
225 } | |
226 | |
8999 | 227 static void |
228 received_im_msg_cb(GaimAccount *account, char *sender, char *buffer, | |
229 int flags, void *data) | |
230 { | |
231 gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %d)\n", | |
232 gaim_account_get_username(account), sender, buffer, | |
233 flags); | |
234 } | |
235 | |
6485 | 236 static gboolean |
7503 | 237 displaying_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
238 char **buffer, void *data) | |
6485 | 239 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
240 gaim_debug_misc("signals test", "displaying-chat-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
241 gaim_conversation_get_name(conv), *buffer); |
6485 | 242 |
6486
fab81e4b885c
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
243 return FALSE; |
6485 | 244 } |
245 | |
246 static void | |
9051 | 247 displayed_chat_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) |
6485 | 248 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
249 gaim_debug_misc("signals test", "displayed-chat-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
250 gaim_conversation_get_name(conv), buffer); |
6485 | 251 } |
252 | |
253 static gboolean | |
9051 | 254 writing_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
255 char **buffer, void *data) | |
256 { | |
257 gaim_debug_misc("signals test", "writing-chat-msg (%s, %s)\n", | |
258 gaim_conversation_get_name(conv), *buffer); | |
259 | |
260 return FALSE; | |
261 } | |
262 | |
263 static void | |
264 wrote_chat_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) | |
265 { | |
266 gaim_debug_misc("signals test", "wrote-chat-msg (%s, %s)\n", | |
267 gaim_conversation_get_name(conv), buffer); | |
268 } | |
269 | |
270 static gboolean | |
6509 | 271 sending_chat_msg_cb(GaimAccount *account, char **buffer, int id, void *data) |
6485 | 272 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
273 gaim_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
274 gaim_account_get_username(account), *buffer, id); |
6485 | 275 |
276 return FALSE; | |
277 } | |
278 | |
279 static void | |
6509 | 280 sent_chat_msg_cb(GaimAccount *account, const char *buffer, int id, void *data) |
6485 | 281 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
282 gaim_debug_misc("signals test", "sent-chat-msg (%s, %s, %d)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
283 gaim_account_get_username(account), buffer, id); |
6485 | 284 } |
285 | |
286 static gboolean | |
8999 | 287 receiving_chat_msg_cb(GaimAccount *account, char **sender, char **buffer, |
7516
4749299f199a
[gaim-migrate @ 8129]
Christian Hammond <chipx86@chipx86.com>
parents:
7503
diff
changeset
|
288 GaimConversation *chat, void *data) |
6485 | 289 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
290 gaim_debug_misc("signals test", |
8999 | 291 "receiving-chat-msg (%s, %s, %s, %s)\n", |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
292 gaim_account_get_username(account), *sender, *buffer, |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
293 gaim_conversation_get_name(chat)); |
6485 | 294 |
295 return FALSE; | |
296 } | |
297 | |
298 static void | |
8999 | 299 received_chat_msg_cb(GaimAccount *account, char *sender, char *buffer, |
300 GaimConversation *chat, void *data) | |
301 { | |
302 gaim_debug_misc("signals test", | |
303 "received-chat-msg (%s, %s, %s, %s)\n", | |
304 gaim_account_get_username(account), sender, buffer, | |
305 gaim_conversation_get_name(chat)); | |
306 } | |
307 | |
308 static void | |
6485 | 309 conversation_switching_cb(GaimConversation *old_conv, |
310 GaimConversation *new_conv, void *data) | |
311 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
312 gaim_debug_misc("signals test", "conversation-switching (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
313 gaim_conversation_get_name(old_conv), |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
314 gaim_conversation_get_name(new_conv)); |
6485 | 315 } |
316 | |
317 static void | |
318 conversation_switched_cb(GaimConversation *old_conv, | |
319 GaimConversation *new_conv, void *data) | |
320 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
321 gaim_debug_misc("signals test", "conversation-switched (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
322 gaim_conversation_get_name(old_conv), |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
323 gaim_conversation_get_name(new_conv)); |
6485 | 324 } |
325 | |
326 static void | |
327 conversation_created_cb(GaimConversation *conv, void *data) | |
328 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
329 gaim_debug_misc("signals test", "conversation-created (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
330 gaim_conversation_get_name(conv)); |
6485 | 331 } |
332 | |
333 static void | |
334 deleting_conversation_cb(GaimConversation *conv, void *data) | |
335 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
336 gaim_debug_misc("signals test", "deleting-conversation (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
337 gaim_conversation_get_name(conv)); |
6485 | 338 } |
339 | |
340 static void | |
341 buddy_typing_cb(GaimConversation *conv, void *data) | |
342 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
343 gaim_debug_misc("signals test", "buddy-typing (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
344 gaim_conversation_get_name(conv)); |
6485 | 345 } |
346 | |
9587 | 347 static gboolean |
9554 | 348 chat_buddy_joining_cb(GaimConversation *conv, const char *user, |
349 GaimConvChatBuddyFlags flags, void *data) | |
6485 | 350 { |
9554 | 351 gaim_debug_misc("signals test", "chat-buddy-joining (%s, %s, %d)\n", |
352 gaim_conversation_get_name(conv), user, flags); | |
9587 | 353 |
354 return FALSE; | |
6485 | 355 } |
356 | |
357 static void | |
9554 | 358 chat_buddy_joined_cb(GaimConversation *conv, const char *user, |
359 GaimConvChatBuddyFlags flags, void *data) | |
6485 | 360 { |
9554 | 361 gaim_debug_misc("signals test", "chat-buddy-joined (%s, %s, %d)\n", |
362 gaim_conversation_get_name(conv), user, flags); | |
363 } | |
364 | |
365 static void | |
366 chat_buddy_flags_cb(GaimConversation *conv, const char *user, | |
367 GaimConvChatBuddyFlags oldflags, GaimConvChatBuddyFlags newflags, void *data) | |
368 { | |
369 gaim_debug_misc("signals test", "chat-buddy-flags (%s, %s, %d, %d)\n", | |
370 gaim_conversation_get_name(conv), user, oldflags, newflags); | |
6485 | 371 } |
372 | |
9587 | 373 static gboolean |
6485 | 374 chat_buddy_leaving_cb(GaimConversation *conv, const char *user, |
375 const char *reason, void *data) | |
376 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
377 gaim_debug_misc("signals test", "chat-buddy-leaving (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
378 gaim_conversation_get_name(conv), user, reason); |
9587 | 379 |
380 return FALSE; | |
6485 | 381 } |
382 | |
383 static void | |
384 chat_buddy_left_cb(GaimConversation *conv, const char *user, | |
385 const char *reason, void *data) | |
386 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
387 gaim_debug_misc("signals test", "chat-buddy-left (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
388 gaim_conversation_get_name(conv), user, reason); |
6485 | 389 } |
390 | |
391 static void | |
392 chat_inviting_user_cb(GaimConversation *conv, const char *name, | |
9554 | 393 char **reason, void *data) |
6485 | 394 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
395 gaim_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n", |
9554 | 396 gaim_conversation_get_name(conv), name, *reason); |
6485 | 397 } |
398 | |
399 static void | |
400 chat_invited_user_cb(GaimConversation *conv, const char *name, | |
401 const char *reason, void *data) | |
402 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
403 gaim_debug_misc("signals test", "chat-invited-user (%s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
404 gaim_conversation_get_name(conv), name, reason); |
6485 | 405 } |
406 | |
407 static void | |
408 chat_invited_cb(GaimAccount *account, const char *inviter, | |
9514 | 409 const char *room_name, const char *message, |
410 const GHashTable *components, void *data) | |
6485 | 411 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
412 gaim_debug_misc("signals test", "chat-invited (%s, %s, %s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
413 gaim_account_get_username(account), inviter, |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
414 room_name, message); |
6485 | 415 } |
416 | |
417 static void | |
418 chat_joined_cb(GaimConversation *conv, void *data) | |
419 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
420 gaim_debug_misc("signals test", "chat-joined (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
421 gaim_conversation_get_name(conv)); |
6485 | 422 } |
423 | |
424 static void | |
425 chat_left_cb(GaimConversation *conv, void *data) | |
426 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
427 gaim_debug_misc("signals test", "chat-left (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
428 gaim_conversation_get_name(conv)); |
6485 | 429 } |
430 | |
9517 | 431 static void |
432 chat_topic_changed_cb(GaimConversation *conv, const char *who, | |
433 const char *topic, void *data) | |
434 { | |
435 gaim_debug_misc("signals test", | |
436 "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n", | |
437 gaim_conversation_get_name(conv), topic, | |
438 (who) ? who : "unknown"); | |
439 } | |
6485 | 440 /************************************************************************** |
441 * Core signal callbacks | |
442 **************************************************************************/ | |
443 static void | |
444 quitting_cb(void *data) | |
445 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
446 gaim_debug_misc("signals test", "quitting ()\n"); |
6485 | 447 } |
448 | |
449 /************************************************************************** | |
450 * Plugin stuff | |
451 **************************************************************************/ | |
452 static gboolean | |
453 plugin_load(GaimPlugin *plugin) | |
454 { | |
455 void *core_handle = gaim_get_core(); | |
456 void *blist_handle = gaim_blist_get_handle(); | |
457 void *conn_handle = gaim_connections_get_handle(); | |
458 void *conv_handle = gaim_conversations_get_handle(); | |
459 void *accounts_handle = gaim_accounts_get_handle(); | |
460 | |
461 /* Accounts subsystem signals */ | |
462 gaim_signal_connect(accounts_handle, "account-connecting", | |
463 plugin, GAIM_CALLBACK(account_connecting_cb), NULL); | |
464 gaim_signal_connect(accounts_handle, "account-away", | |
465 plugin, GAIM_CALLBACK(account_away_cb), NULL); | |
466 gaim_signal_connect(accounts_handle, "account-setting-info", | |
467 plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); | |
468 gaim_signal_connect(accounts_handle, "account-set-info", | |
469 plugin, GAIM_CALLBACK(account_set_info_cb), NULL); | |
470 gaim_signal_connect(accounts_handle, "account-warned", | |
471 plugin, GAIM_CALLBACK(account_warned_cb), NULL); | |
472 | |
473 /* Buddy List subsystem signals */ | |
474 gaim_signal_connect(blist_handle, "buddy-away", | |
475 plugin, GAIM_CALLBACK(buddy_away_cb), NULL); | |
476 gaim_signal_connect(blist_handle, "buddy-back", | |
477 plugin, GAIM_CALLBACK(buddy_back_cb), NULL); | |
478 gaim_signal_connect(blist_handle, "buddy-idle", | |
479 plugin, GAIM_CALLBACK(buddy_idle_cb), NULL); | |
480 gaim_signal_connect(blist_handle, "buddy-unidle", | |
481 plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL); | |
482 gaim_signal_connect(blist_handle, "buddy-signed-on", | |
483 plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); | |
484 gaim_signal_connect(blist_handle, "buddy-signed-off", | |
485 plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); | |
9051 | 486 gaim_signal_connect(blist_handle, "blist-node-extended-menu", |
487 plugin, GAIM_CALLBACK(blist_node_extended_menu_cb), NULL); | |
6485 | 488 |
489 /* Connection subsystem signals */ | |
490 gaim_signal_connect(conn_handle, "signing-on", | |
491 plugin, GAIM_CALLBACK(signing_on_cb), NULL); | |
492 gaim_signal_connect(conn_handle, "signed-on", | |
493 plugin, GAIM_CALLBACK(signed_on_cb), NULL); | |
494 gaim_signal_connect(conn_handle, "signing-off", | |
495 plugin, GAIM_CALLBACK(signing_off_cb), NULL); | |
496 gaim_signal_connect(conn_handle, "signed-off", | |
497 plugin, GAIM_CALLBACK(signed_off_cb), NULL); | |
498 | |
499 /* Conversations subsystem signals */ | |
500 gaim_signal_connect(conv_handle, "displaying-im-msg", | |
501 plugin, GAIM_CALLBACK(displaying_im_msg_cb), NULL); | |
6489 | 502 gaim_signal_connect(conv_handle, "displayed-im-msg", |
6485 | 503 plugin, GAIM_CALLBACK(displayed_im_msg_cb), NULL); |
9051 | 504 gaim_signal_connect(conv_handle, "writing-im-msg", |
505 plugin, GAIM_CALLBACK(writing_im_msg_cb), NULL); | |
506 gaim_signal_connect(conv_handle, "wrote-im-msg", | |
507 plugin, GAIM_CALLBACK(wrote_im_msg_cb), NULL); | |
6485 | 508 gaim_signal_connect(conv_handle, "sending-im-msg", |
509 plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); | |
510 gaim_signal_connect(conv_handle, "sent-im-msg", | |
511 plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); | |
8999 | 512 gaim_signal_connect(conv_handle, "receiving-im-msg", |
513 plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); | |
6485 | 514 gaim_signal_connect(conv_handle, "received-im-msg", |
515 plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); | |
516 gaim_signal_connect(conv_handle, "displaying-chat-msg", | |
517 plugin, GAIM_CALLBACK(displaying_chat_msg_cb), NULL); | |
518 gaim_signal_connect(conv_handle, "displayed-chat-msg", | |
519 plugin, GAIM_CALLBACK(displayed_chat_msg_cb), NULL); | |
9051 | 520 gaim_signal_connect(conv_handle, "writing-chat-msg", |
521 plugin, GAIM_CALLBACK(writing_chat_msg_cb), NULL); | |
522 gaim_signal_connect(conv_handle, "wrote-chat-msg", | |
523 plugin, GAIM_CALLBACK(wrote_chat_msg_cb), NULL); | |
6485 | 524 gaim_signal_connect(conv_handle, "sending-chat-msg", |
525 plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); | |
526 gaim_signal_connect(conv_handle, "sent-chat-msg", | |
527 plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); | |
8999 | 528 gaim_signal_connect(conv_handle, "receiving-chat-msg", |
529 plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL); | |
6485 | 530 gaim_signal_connect(conv_handle, "received-chat-msg", |
531 plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); | |
532 gaim_signal_connect(conv_handle, "conversation-switching", | |
533 plugin, GAIM_CALLBACK(conversation_switching_cb), NULL); | |
534 gaim_signal_connect(conv_handle, "conversation-switched", | |
535 plugin, GAIM_CALLBACK(conversation_switched_cb), NULL); | |
536 gaim_signal_connect(conv_handle, "conversation-created", | |
537 plugin, GAIM_CALLBACK(conversation_created_cb), NULL); | |
538 gaim_signal_connect(conv_handle, "deleting-conversation", | |
539 plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); | |
540 gaim_signal_connect(conv_handle, "buddy-typing", | |
541 plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); | |
542 gaim_signal_connect(conv_handle, "chat-buddy-joining", | |
543 plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); | |
544 gaim_signal_connect(conv_handle, "chat-buddy-joined", | |
545 plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); | |
9554 | 546 gaim_signal_connect(conv_handle, "chat-buddy-flags", |
547 plugin, GAIM_CALLBACK(chat_buddy_flags_cb), NULL); | |
6485 | 548 gaim_signal_connect(conv_handle, "chat-buddy-leaving", |
549 plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); | |
550 gaim_signal_connect(conv_handle, "chat-buddy-left", | |
551 plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); | |
552 gaim_signal_connect(conv_handle, "chat-inviting-user", | |
553 plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); | |
554 gaim_signal_connect(conv_handle, "chat-invited-user", | |
555 plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); | |
556 gaim_signal_connect(conv_handle, "chat-invited", | |
557 plugin, GAIM_CALLBACK(chat_invited_cb), NULL); | |
558 gaim_signal_connect(conv_handle, "chat-joined", | |
559 plugin, GAIM_CALLBACK(chat_joined_cb), NULL); | |
560 gaim_signal_connect(conv_handle, "chat-left", | |
561 plugin, GAIM_CALLBACK(chat_left_cb), NULL); | |
9517 | 562 gaim_signal_connect(conv_handle, "chat-topic-changed", |
563 plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL); | |
6485 | 564 |
565 /* Core signals */ | |
566 gaim_signal_connect(core_handle, "quitting", | |
567 plugin, GAIM_CALLBACK(quitting_cb), NULL); | |
568 | |
569 return TRUE; | |
570 } | |
571 | |
572 static GaimPluginInfo info = | |
573 { | |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
7517
diff
changeset
|
574 GAIM_PLUGIN_API_VERSION, /**< api_version */ |
6485 | 575 GAIM_PLUGIN_STANDARD, /**< type */ |
576 NULL, /**< ui_requirement */ | |
577 0, /**< flags */ | |
578 NULL, /**< dependencies */ | |
579 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
580 | |
581 SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
582 N_("Signals Test"), /**< name */ | |
583 VERSION, /**< version */ | |
584 /** summary */ | |
585 N_("Test to see that all signals are working properly."), | |
586 /** description */ | |
587 N_("Test to see that all signals are working properly."), | |
588 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
589 GAIM_WEBSITE, /**< homepage */ | |
590 | |
591 plugin_load, /**< load */ | |
592 NULL, /**< unload */ | |
593 NULL, /**< destroy */ | |
594 | |
595 NULL, /**< ui_info */ | |
8993 | 596 NULL, /**< extra_info */ |
597 NULL, | |
598 NULL | |
6485 | 599 }; |
600 | |
601 static void | |
602 init_plugin(GaimPlugin *plugin) | |
603 { | |
604 } | |
605 | |
606 GAIM_INIT_PLUGIN(signalstest, init_plugin, info) |