Mercurial > pidgin.yaz
annotate plugins/signals-test.c @ 12547:a25bdcad6b21
[gaim-migrate @ 14865]
La la la la laaaaaaa, little birdies
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 18 Dec 2005 15:22:58 +0000 |
parents | ac63b000ed42 |
children | 71299d63801d |
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" | |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
26 #include "cipher.h" |
6485 | 27 #include "connection.h" |
28 #include "conversation.h" | |
29 #include "core.h" | |
30 #include "debug.h" | |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
31 #include "ft.h" |
6485 | 32 #include "signals.h" |
9954 | 33 #include "version.h" |
11628 | 34 #include "status.h" |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
35 #include "sound.h" |
6485 | 36 |
37 /************************************************************************** | |
38 * Account subsystem signal callbacks | |
39 **************************************************************************/ | |
40 static void | |
41 account_connecting_cb(GaimAccount *account, void *data) | |
42 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
43 gaim_debug_misc("signals test", "account-connecting (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
44 gaim_account_get_username(account)); |
6485 | 45 } |
46 | |
47 static void | |
48 account_setting_info_cb(GaimAccount *account, const char *info, void *data) | |
49 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
50 gaim_debug_misc("signals test", "account-setting-info (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
51 gaim_account_get_username(account), info); |
6485 | 52 } |
53 | |
54 static void | |
55 account_set_info_cb(GaimAccount *account, const char *info, void *data) | |
56 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
57 gaim_debug_misc("signals test", "account-set-info (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
58 gaim_account_get_username(account), info); |
6485 | 59 } |
60 | |
11628 | 61 static void |
62 account_status_changed(GaimAccount *account, GaimStatus *old, GaimStatus *new, | |
63 gpointer data) | |
64 { | |
65 gaim_debug_misc("signals test", "account-status-changed (%s, %s, %s)\n", | |
66 gaim_account_get_username(account), | |
67 gaim_status_get_name(old), | |
68 gaim_status_get_name(new)); | |
69 } | |
70 | |
6485 | 71 /************************************************************************** |
10934 | 72 * Buddy Icons signal callbacks |
73 **************************************************************************/ | |
74 static void | |
12293
ac63b000ed42
[gaim-migrate @ 14597]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12291
diff
changeset
|
75 buddy_icon_changed_cb(GaimBuddy *buddy) |
10934 | 76 { |
12098
a726740ce86e
[gaim-migrate @ 14395]
Richard Laager <rlaager@wiktel.com>
parents:
12097
diff
changeset
|
77 gaim_debug_misc("signals test", "buddy icon changed (%s)\n", |
12097 | 78 gaim_buddy_get_name(buddy)); |
10934 | 79 } |
80 | |
81 /************************************************************************** | |
6485 | 82 * Buddy List subsystem signal callbacks |
83 **************************************************************************/ | |
84 static void | |
11935
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
85 buddy_status_changed_cb(GaimBuddy *buddy, GaimStatus *old_status, |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
86 GaimStatus *status, void *data) |
6485 | 87 { |
11935
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
88 gaim_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n", |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
89 buddy->name, gaim_status_get_id(old_status), |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
90 gaim_status_get_id(status)); |
6485 | 91 } |
92 | |
93 static void | |
11935
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
94 buddy_idle_changed_cb(GaimBuddy *buddy, gboolean old_idle, gboolean idle, |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
95 void *data) |
6485 | 96 { |
11935
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
97 gaim_debug_misc("signals test", "buddy-idle-changed (%s %s)\n", |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
98 buddy->name, old_idle ? "unidled" : "idled"); |
6485 | 99 } |
100 | |
101 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
102 buddy_signed_on_cb(GaimBuddy *buddy, void *data) |
6485 | 103 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
104 gaim_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); |
6485 | 105 } |
106 | |
107 static void | |
7009
d77e99c55b40
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
108 buddy_signed_off_cb(GaimBuddy *buddy, void *data) |
6485 | 109 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
110 gaim_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); |
6485 | 111 } |
112 | |
8999 | 113 static void |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
114 buddy_added_cb(GaimBuddy *buddy, void *data) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
115 { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
116 gaim_debug_misc("signals test", "buddy_added_cb (%s)\n", gaim_buddy_get_name(buddy)); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
117 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
118 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
119 static void |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
120 buddy_removed_cb(GaimBuddy *buddy, void *data) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
121 { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
122 gaim_debug_misc("signals test", "buddy_removed_cb (%s)\n", gaim_buddy_get_name(buddy)); |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
123 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
124 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
125 static void |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
126 blist_node_aliased(GaimBlistNode *node, const char *old_alias) |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
127 { |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
128 GaimContact *p = (GaimContact *)node; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
129 GaimBuddy *b = (GaimBuddy *)node; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
130 GaimChat *c = (GaimChat *)node; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
131 GaimGroup *g = (GaimGroup *)node; |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
132 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
133 if (GAIM_BLIST_NODE_IS_CONTACT(node)) |
11748 | 134 gaim_debug_misc("signals test", "blist-node-aliased (Contact: %s, %s)\n", p->alias, old_alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
135 else if (GAIM_BLIST_NODE_IS_BUDDY(node)) |
11748 | 136 gaim_debug_misc("signals test", "blist-node-aliased (Buddy: %s, %s)\n", b->name, old_alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
137 else if (GAIM_BLIST_NODE_IS_CHAT(node)) |
11748 | 138 gaim_debug_misc("signals test", "blist-node-aliased (Chat: %s, %s)\n", c->alias, old_alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
139 else if (GAIM_BLIST_NODE_IS_GROUP(node)) |
11748 | 140 gaim_debug_misc("signals test", "blist-node-aliased (Group: %s, %s)\n", g->name, old_alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
141 else |
11748 | 142 gaim_debug_misc("signals test", "blist-node-aliased (UNKNOWN: %d, %s)\n", node->type, old_alias); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
143 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
144 } |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
145 |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
146 static void |
9051 | 147 blist_node_extended_menu_cb(GaimBlistNode *node, void *data) |
8999 | 148 { |
9051 | 149 GaimContact *p = (GaimContact *)node; |
150 GaimBuddy *b = (GaimBuddy *)node; | |
151 GaimChat *c = (GaimChat *)node; | |
152 GaimGroup *g = (GaimGroup *)node; | |
8999 | 153 |
9051 | 154 if (GAIM_BLIST_NODE_IS_CONTACT(node)) |
155 gaim_debug_misc("signals test", "blist-node-extended-menu (Contact: %s)\n", p->alias); | |
156 else if (GAIM_BLIST_NODE_IS_BUDDY(node)) | |
157 gaim_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s)\n", b->name); | |
158 else if (GAIM_BLIST_NODE_IS_CHAT(node)) | |
159 gaim_debug_misc("signals test", "blist-node-extended-menu (Chat: %s)\n", c->alias); | |
160 else if (GAIM_BLIST_NODE_IS_GROUP(node)) | |
161 gaim_debug_misc("signals test", "blist-node-extended-menu (Group: %s)\n", g->name); | |
162 else | |
163 gaim_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d)\n", node->type); | |
164 | |
8999 | 165 } |
166 | |
167 | |
6485 | 168 /************************************************************************** |
169 * Connection subsystem signal callbacks | |
170 **************************************************************************/ | |
171 static void | |
172 signing_on_cb(GaimConnection *gc, void *data) | |
173 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
174 gaim_debug_misc("signals test", "signing-on (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
175 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 176 } |
177 | |
178 static void | |
179 signed_on_cb(GaimConnection *gc, void *data) | |
180 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
181 gaim_debug_misc("signals test", "signed-on (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
182 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 183 } |
184 | |
185 static void | |
186 signing_off_cb(GaimConnection *gc, void *data) | |
187 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
188 gaim_debug_misc("signals test", "signing-off (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
189 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 190 } |
191 | |
192 static void | |
193 signed_off_cb(GaimConnection *gc, void *data) | |
194 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
195 gaim_debug_misc("signals test", "signed-off (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
196 gaim_account_get_username(gaim_connection_get_account(gc))); |
6485 | 197 } |
198 | |
199 /************************************************************************** | |
200 * Conversation subsystem signal callbacks | |
201 **************************************************************************/ | |
202 static gboolean | |
7503 | 203 displaying_im_msg_cb(GaimAccount *account, GaimConversation *conv, |
204 char **buffer, void *data) | |
6485 | 205 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
206 gaim_debug_misc("signals test", "displaying-im-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
207 gaim_conversation_get_name(conv), *buffer); |
6485 | 208 |
209 return FALSE; | |
210 } | |
211 | |
212 static void | |
9051 | 213 displayed_im_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) |
6485 | 214 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
215 gaim_debug_misc("signals test", "displayed-im-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
216 gaim_conversation_get_name(conv), buffer); |
6485 | 217 } |
218 | |
9051 | 219 static gboolean |
220 writing_im_msg_cb(GaimAccount *account, GaimConversation *conv, char **buffer, void *data) | |
221 { | |
222 gaim_debug_misc("signals test", "writing-im-msg (%s, %s, %s)\n", | |
223 gaim_account_get_username(account), gaim_conversation_get_name(conv), *buffer); | |
224 | |
225 return FALSE; | |
226 | |
227 } | |
228 | |
229 static void | |
230 wrote_im_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) | |
231 { | |
232 gaim_debug_misc("signals test", "wrote-im-msg (%s, %s, %s)\n", | |
233 gaim_account_get_username(account), gaim_conversation_get_name(conv), buffer); | |
234 } | |
235 | |
7503 | 236 static void |
6509 | 237 sending_im_msg_cb(GaimAccount *account, char *recipient, char **buffer, void *data) |
6485 | 238 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
239 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
|
240 gaim_account_get_username(account), recipient, *buffer); |
6485 | 241 |
242 } | |
243 | |
244 static void | |
6509 | 245 sent_im_msg_cb(GaimAccount *account, const char *recipient, const char *buffer, void *data) |
6485 | 246 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
247 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
|
248 gaim_account_get_username(account), recipient, buffer); |
6485 | 249 } |
250 | |
251 static gboolean | |
8999 | 252 receiving_im_msg_cb(GaimAccount *account, char **sender, char **buffer, |
10104 | 253 GaimConversation *conv, int *flags, void *data) |
6485 | 254 { |
10104 | 255 gaim_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %s, %d)\n", |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
256 gaim_account_get_username(account), *sender, *buffer, |
11899 | 257 (conv != NULL) ? gaim_conversation_get_name(conv) : "(null)", *flags); |
6485 | 258 |
259 return FALSE; | |
260 } | |
261 | |
8999 | 262 static void |
263 received_im_msg_cb(GaimAccount *account, char *sender, char *buffer, | |
10104 | 264 GaimConversation *conv, int flags, void *data) |
8999 | 265 { |
10104 | 266 gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %s, %d)\n", |
8999 | 267 gaim_account_get_username(account), sender, buffer, |
11899 | 268 (conv != NULL) ? gaim_conversation_get_name(conv) : "(null)", flags); |
8999 | 269 } |
270 | |
6485 | 271 static gboolean |
7503 | 272 displaying_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
273 char **buffer, void *data) | |
6485 | 274 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
275 gaim_debug_misc("signals test", "displaying-chat-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
276 gaim_conversation_get_name(conv), *buffer); |
6485 | 277 |
6486
fab81e4b885c
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
278 return FALSE; |
6485 | 279 } |
280 | |
281 static void | |
9051 | 282 displayed_chat_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) |
6485 | 283 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
284 gaim_debug_misc("signals test", "displayed-chat-msg (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
285 gaim_conversation_get_name(conv), buffer); |
6485 | 286 } |
287 | |
288 static gboolean | |
9051 | 289 writing_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
290 char **buffer, void *data) | |
291 { | |
292 gaim_debug_misc("signals test", "writing-chat-msg (%s, %s)\n", | |
293 gaim_conversation_get_name(conv), *buffer); | |
294 | |
295 return FALSE; | |
296 } | |
297 | |
298 static void | |
299 wrote_chat_msg_cb(GaimAccount *account, GaimConversation *conv, const char *buffer, void *data) | |
300 { | |
301 gaim_debug_misc("signals test", "wrote-chat-msg (%s, %s)\n", | |
302 gaim_conversation_get_name(conv), buffer); | |
303 } | |
304 | |
305 static gboolean | |
6509 | 306 sending_chat_msg_cb(GaimAccount *account, char **buffer, int id, void *data) |
6485 | 307 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
308 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
|
309 gaim_account_get_username(account), *buffer, id); |
6485 | 310 |
311 return FALSE; | |
312 } | |
313 | |
314 static void | |
6509 | 315 sent_chat_msg_cb(GaimAccount *account, const char *buffer, int id, void *data) |
6485 | 316 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
317 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
|
318 gaim_account_get_username(account), buffer, id); |
6485 | 319 } |
320 | |
321 static gboolean | |
8999 | 322 receiving_chat_msg_cb(GaimAccount *account, char **sender, char **buffer, |
10104 | 323 GaimConversation *chat, int *flags, void *data) |
6485 | 324 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
325 gaim_debug_misc("signals test", |
10104 | 326 "receiving-chat-msg (%s, %s, %s, %s, %d)\n", |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
327 gaim_account_get_username(account), *sender, *buffer, |
10104 | 328 gaim_conversation_get_name(chat), *flags); |
6485 | 329 |
330 return FALSE; | |
331 } | |
332 | |
333 static void | |
8999 | 334 received_chat_msg_cb(GaimAccount *account, char *sender, char *buffer, |
10104 | 335 GaimConversation *chat, int flags, void *data) |
8999 | 336 { |
337 gaim_debug_misc("signals test", | |
10104 | 338 "received-chat-msg (%s, %s, %s, %s, %d)\n", |
8999 | 339 gaim_account_get_username(account), sender, buffer, |
10104 | 340 gaim_conversation_get_name(chat), flags); |
8999 | 341 } |
342 | |
343 static void | |
6485 | 344 conversation_switching_cb(GaimConversation *old_conv, |
345 GaimConversation *new_conv, void *data) | |
346 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
347 gaim_debug_misc("signals test", "conversation-switching (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
348 gaim_conversation_get_name(old_conv), |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
349 gaim_conversation_get_name(new_conv)); |
6485 | 350 } |
351 | |
352 static void | |
353 conversation_switched_cb(GaimConversation *old_conv, | |
354 GaimConversation *new_conv, void *data) | |
355 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
356 gaim_debug_misc("signals test", "conversation-switched (%s, %s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
357 gaim_conversation_get_name(old_conv), |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
358 gaim_conversation_get_name(new_conv)); |
6485 | 359 } |
360 | |
361 static void | |
362 conversation_created_cb(GaimConversation *conv, void *data) | |
363 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
364 gaim_debug_misc("signals test", "conversation-created (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
365 gaim_conversation_get_name(conv)); |
6485 | 366 } |
367 | |
368 static void | |
369 deleting_conversation_cb(GaimConversation *conv, void *data) | |
370 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
371 gaim_debug_misc("signals test", "deleting-conversation (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
372 gaim_conversation_get_name(conv)); |
6485 | 373 } |
374 | |
375 static void | |
11706
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
376 buddy_typing_cb(GaimAccount *account, const char *name, void *data) |
6485 | 377 { |
11706
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
378 gaim_debug_misc("signals test", "buddy-typing (%s, %s)\n", |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
379 gaim_account_get_username(account), name); |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
380 } |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
381 |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
382 static void |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
383 buddy_typing_stopped_cb(GaimAccount *account, const char *name, void *data) |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
384 { |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
385 gaim_debug_misc("signals test", "buddy-typing-stopped (%s, %s)\n", |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
386 gaim_account_get_username(account), name); |
6485 | 387 } |
388 | |
9587 | 389 static gboolean |
9554 | 390 chat_buddy_joining_cb(GaimConversation *conv, const char *user, |
391 GaimConvChatBuddyFlags flags, void *data) | |
6485 | 392 { |
9554 | 393 gaim_debug_misc("signals test", "chat-buddy-joining (%s, %s, %d)\n", |
394 gaim_conversation_get_name(conv), user, flags); | |
9587 | 395 |
396 return FALSE; | |
6485 | 397 } |
398 | |
399 static void | |
9554 | 400 chat_buddy_joined_cb(GaimConversation *conv, const char *user, |
401 GaimConvChatBuddyFlags flags, void *data) | |
6485 | 402 { |
9554 | 403 gaim_debug_misc("signals test", "chat-buddy-joined (%s, %s, %d)\n", |
404 gaim_conversation_get_name(conv), user, flags); | |
405 } | |
406 | |
407 static void | |
408 chat_buddy_flags_cb(GaimConversation *conv, const char *user, | |
409 GaimConvChatBuddyFlags oldflags, GaimConvChatBuddyFlags newflags, void *data) | |
410 { | |
411 gaim_debug_misc("signals test", "chat-buddy-flags (%s, %s, %d, %d)\n", | |
412 gaim_conversation_get_name(conv), user, oldflags, newflags); | |
6485 | 413 } |
414 | |
9587 | 415 static gboolean |
6485 | 416 chat_buddy_leaving_cb(GaimConversation *conv, const char *user, |
417 const char *reason, void *data) | |
418 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
419 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
|
420 gaim_conversation_get_name(conv), user, reason); |
9587 | 421 |
422 return FALSE; | |
6485 | 423 } |
424 | |
425 static void | |
426 chat_buddy_left_cb(GaimConversation *conv, const char *user, | |
427 const char *reason, void *data) | |
428 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
429 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
|
430 gaim_conversation_get_name(conv), user, reason); |
6485 | 431 } |
432 | |
433 static void | |
434 chat_inviting_user_cb(GaimConversation *conv, const char *name, | |
9554 | 435 char **reason, void *data) |
6485 | 436 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
437 gaim_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n", |
9554 | 438 gaim_conversation_get_name(conv), name, *reason); |
6485 | 439 } |
440 | |
441 static void | |
442 chat_invited_user_cb(GaimConversation *conv, const char *name, | |
443 const char *reason, void *data) | |
444 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
445 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
|
446 gaim_conversation_get_name(conv), name, reason); |
6485 | 447 } |
448 | |
11064
e4459e8ccfb5
[gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
449 static gint |
6485 | 450 chat_invited_cb(GaimAccount *account, const char *inviter, |
9514 | 451 const char *room_name, const char *message, |
452 const GHashTable *components, void *data) | |
6485 | 453 { |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
454 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
|
455 gaim_account_get_username(account), inviter, |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
456 room_name, message); |
11064
e4459e8ccfb5
[gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
457 |
e4459e8ccfb5
[gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents:
11033
diff
changeset
|
458 return 0; |
6485 | 459 } |
460 | |
461 static void | |
462 chat_joined_cb(GaimConversation *conv, void *data) | |
463 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
464 gaim_debug_misc("signals test", "chat-joined (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
465 gaim_conversation_get_name(conv)); |
6485 | 466 } |
467 | |
468 static void | |
469 chat_left_cb(GaimConversation *conv, void *data) | |
470 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
471 gaim_debug_misc("signals test", "chat-left (%s)\n", |
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
472 gaim_conversation_get_name(conv)); |
6485 | 473 } |
474 | |
9517 | 475 static void |
476 chat_topic_changed_cb(GaimConversation *conv, const char *who, | |
477 const char *topic, void *data) | |
478 { | |
479 gaim_debug_misc("signals test", | |
480 "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n", | |
481 gaim_conversation_get_name(conv), topic, | |
482 (who) ? who : "unknown"); | |
483 } | |
6485 | 484 /************************************************************************** |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
485 * Ciphers signal callbacks |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
486 **************************************************************************/ |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
487 static void |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
488 cipher_added_cb(GaimCipher *cipher, void *data) { |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
489 gaim_debug_misc("signals test", "cipher %s added\n", |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
490 gaim_cipher_get_name(cipher)); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
491 } |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
492 |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
493 static void |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
494 cipher_removed_cb(GaimCipher *cipher, void *data) { |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
495 gaim_debug_misc("signals test", "cipher %s removed\n", |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
496 gaim_cipher_get_name(cipher)); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
497 } |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
498 |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
499 /************************************************************************** |
6485 | 500 * Core signal callbacks |
501 **************************************************************************/ | |
502 static void | |
503 quitting_cb(void *data) | |
504 { | |
7517
767d3db53e17
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
505 gaim_debug_misc("signals test", "quitting ()\n"); |
6485 | 506 } |
507 | |
508 /************************************************************************** | |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
509 * File transfer signal callbacks |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
510 **************************************************************************/ |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
511 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
512 ft_recv_accept_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
513 gaim_debug_misc("signals test", "file receive accepted\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
514 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
515 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
516 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
517 ft_send_accept_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
518 gaim_debug_misc("signals test", "file send accepted\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
519 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
520 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
521 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
522 ft_recv_start_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
523 gaim_debug_misc("signals test", "file receive started\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
524 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
525 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
526 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
527 ft_send_start_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
528 gaim_debug_misc("signals test", "file send started\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
529 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
530 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
531 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
532 ft_recv_cancel_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
533 gaim_debug_misc("signals test", "file receive canceled\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
534 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
535 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
536 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
537 ft_send_cancel_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
538 gaim_debug_misc("signals test", "file send canceled\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
539 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
540 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
541 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
542 ft_recv_complete_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
543 gaim_debug_misc("signals test", "file receive completed\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
544 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
545 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
546 static void |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
547 ft_send_complete_cb(GaimXfer *xfer, gpointer data) { |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
548 gaim_debug_misc("signals test", "file send completed\n"); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
549 } |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
550 |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
551 /************************************************************************** |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
552 * Sound signal callbacks |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
553 **************************************************************************/ |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
554 static int |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
555 sound_playing_event_cb(GaimSoundEventID event, const GaimAccount *account) { |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
556 gaim_debug_misc("signals test", "sound playing event: %d for account: %s\n", |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
557 event, gaim_account_get_username(account)); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
558 |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
559 return 0; |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
560 } |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
561 |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
562 /************************************************************************** |
6485 | 563 * Plugin stuff |
564 **************************************************************************/ | |
565 static gboolean | |
566 plugin_load(GaimPlugin *plugin) | |
567 { | |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
568 void *core_handle = gaim_get_core(); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
569 void *blist_handle = gaim_blist_get_handle(); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
570 void *conn_handle = gaim_connections_get_handle(); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
571 void *conv_handle = gaim_conversations_get_handle(); |
6485 | 572 void *accounts_handle = gaim_accounts_get_handle(); |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
573 void *ciphers_handle = gaim_ciphers_get_handle(); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
574 void *ft_handle = gaim_xfers_get_handle(); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
575 void *sound_handle = gaim_sounds_get_handle(); |
6485 | 576 |
577 /* Accounts subsystem signals */ | |
578 gaim_signal_connect(accounts_handle, "account-connecting", | |
579 plugin, GAIM_CALLBACK(account_connecting_cb), NULL); | |
580 gaim_signal_connect(accounts_handle, "account-setting-info", | |
581 plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); | |
582 gaim_signal_connect(accounts_handle, "account-set-info", | |
583 plugin, GAIM_CALLBACK(account_set_info_cb), NULL); | |
11628 | 584 gaim_signal_connect(accounts_handle, "account-status-changed", |
585 plugin, GAIM_CALLBACK(account_status_changed), NULL); | |
6485 | 586 |
587 /* Buddy List subsystem signals */ | |
11935
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
588 gaim_signal_connect(blist_handle, "buddy-status-changed", |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
589 plugin, GAIM_CALLBACK(buddy_status_changed_cb), NULL); |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
590 gaim_signal_connect(blist_handle, "buddy-idle-changed", |
cb73483c9f63
[gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11899
diff
changeset
|
591 plugin, GAIM_CALLBACK(buddy_idle_changed_cb), NULL); |
6485 | 592 gaim_signal_connect(blist_handle, "buddy-signed-on", |
593 plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); | |
594 gaim_signal_connect(blist_handle, "buddy-signed-off", | |
595 plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); | |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
596 gaim_signal_connect(blist_handle, "buddy-added", |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
597 plugin, GAIM_CALLBACK(buddy_added_cb), NULL); |
12153 | 598 gaim_signal_connect(blist_handle, "buddy-removed", |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
599 plugin, GAIM_CALLBACK(buddy_removed_cb), NULL); |
12097 | 600 gaim_signal_connect(blist_handle, "buddy-icon-changed", |
601 plugin, GAIM_CALLBACK(buddy_icon_changed_cb), NULL); | |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
602 gaim_signal_connect(blist_handle, "blist-node-aliased", |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11281
diff
changeset
|
603 plugin, GAIM_CALLBACK(blist_node_aliased), NULL); |
9051 | 604 gaim_signal_connect(blist_handle, "blist-node-extended-menu", |
605 plugin, GAIM_CALLBACK(blist_node_extended_menu_cb), NULL); | |
6485 | 606 |
607 /* Connection subsystem signals */ | |
608 gaim_signal_connect(conn_handle, "signing-on", | |
609 plugin, GAIM_CALLBACK(signing_on_cb), NULL); | |
610 gaim_signal_connect(conn_handle, "signed-on", | |
611 plugin, GAIM_CALLBACK(signed_on_cb), NULL); | |
612 gaim_signal_connect(conn_handle, "signing-off", | |
613 plugin, GAIM_CALLBACK(signing_off_cb), NULL); | |
614 gaim_signal_connect(conn_handle, "signed-off", | |
615 plugin, GAIM_CALLBACK(signed_off_cb), NULL); | |
616 | |
617 /* Conversations subsystem signals */ | |
618 gaim_signal_connect(conv_handle, "displaying-im-msg", | |
619 plugin, GAIM_CALLBACK(displaying_im_msg_cb), NULL); | |
6489 | 620 gaim_signal_connect(conv_handle, "displayed-im-msg", |
6485 | 621 plugin, GAIM_CALLBACK(displayed_im_msg_cb), NULL); |
9051 | 622 gaim_signal_connect(conv_handle, "writing-im-msg", |
623 plugin, GAIM_CALLBACK(writing_im_msg_cb), NULL); | |
624 gaim_signal_connect(conv_handle, "wrote-im-msg", | |
625 plugin, GAIM_CALLBACK(wrote_im_msg_cb), NULL); | |
6485 | 626 gaim_signal_connect(conv_handle, "sending-im-msg", |
627 plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); | |
628 gaim_signal_connect(conv_handle, "sent-im-msg", | |
629 plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); | |
8999 | 630 gaim_signal_connect(conv_handle, "receiving-im-msg", |
631 plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); | |
6485 | 632 gaim_signal_connect(conv_handle, "received-im-msg", |
633 plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); | |
634 gaim_signal_connect(conv_handle, "displaying-chat-msg", | |
635 plugin, GAIM_CALLBACK(displaying_chat_msg_cb), NULL); | |
636 gaim_signal_connect(conv_handle, "displayed-chat-msg", | |
637 plugin, GAIM_CALLBACK(displayed_chat_msg_cb), NULL); | |
9051 | 638 gaim_signal_connect(conv_handle, "writing-chat-msg", |
639 plugin, GAIM_CALLBACK(writing_chat_msg_cb), NULL); | |
640 gaim_signal_connect(conv_handle, "wrote-chat-msg", | |
641 plugin, GAIM_CALLBACK(wrote_chat_msg_cb), NULL); | |
6485 | 642 gaim_signal_connect(conv_handle, "sending-chat-msg", |
643 plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); | |
644 gaim_signal_connect(conv_handle, "sent-chat-msg", | |
645 plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); | |
8999 | 646 gaim_signal_connect(conv_handle, "receiving-chat-msg", |
647 plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL); | |
6485 | 648 gaim_signal_connect(conv_handle, "received-chat-msg", |
649 plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); | |
650 gaim_signal_connect(conv_handle, "conversation-switching", | |
651 plugin, GAIM_CALLBACK(conversation_switching_cb), NULL); | |
652 gaim_signal_connect(conv_handle, "conversation-switched", | |
653 plugin, GAIM_CALLBACK(conversation_switched_cb), NULL); | |
654 gaim_signal_connect(conv_handle, "conversation-created", | |
655 plugin, GAIM_CALLBACK(conversation_created_cb), NULL); | |
656 gaim_signal_connect(conv_handle, "deleting-conversation", | |
657 plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); | |
658 gaim_signal_connect(conv_handle, "buddy-typing", | |
659 plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); | |
11706
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
660 gaim_signal_connect(conv_handle, "buddy-typing-stopped", |
bcc49c25ef90
[gaim-migrate @ 13997]
Richard Laager <rlaager@wiktel.com>
parents:
11628
diff
changeset
|
661 plugin, GAIM_CALLBACK(buddy_typing_stopped_cb), NULL); |
6485 | 662 gaim_signal_connect(conv_handle, "chat-buddy-joining", |
663 plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); | |
664 gaim_signal_connect(conv_handle, "chat-buddy-joined", | |
665 plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); | |
9554 | 666 gaim_signal_connect(conv_handle, "chat-buddy-flags", |
667 plugin, GAIM_CALLBACK(chat_buddy_flags_cb), NULL); | |
6485 | 668 gaim_signal_connect(conv_handle, "chat-buddy-leaving", |
669 plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); | |
670 gaim_signal_connect(conv_handle, "chat-buddy-left", | |
671 plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); | |
672 gaim_signal_connect(conv_handle, "chat-inviting-user", | |
673 plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); | |
674 gaim_signal_connect(conv_handle, "chat-invited-user", | |
675 plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); | |
676 gaim_signal_connect(conv_handle, "chat-invited", | |
677 plugin, GAIM_CALLBACK(chat_invited_cb), NULL); | |
678 gaim_signal_connect(conv_handle, "chat-joined", | |
679 plugin, GAIM_CALLBACK(chat_joined_cb), NULL); | |
680 gaim_signal_connect(conv_handle, "chat-left", | |
681 plugin, GAIM_CALLBACK(chat_left_cb), NULL); | |
9517 | 682 gaim_signal_connect(conv_handle, "chat-topic-changed", |
683 plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL); | |
6485 | 684 |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
685 /* Ciphers signals */ |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
686 gaim_signal_connect(ciphers_handle, "cipher-added", |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
687 plugin, GAIM_CALLBACK(cipher_added_cb), NULL); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
688 gaim_signal_connect(ciphers_handle, "cipher-removed", |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
689 plugin, GAIM_CALLBACK(cipher_removed_cb), NULL); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10104
diff
changeset
|
690 |
6485 | 691 /* Core signals */ |
692 gaim_signal_connect(core_handle, "quitting", | |
693 plugin, GAIM_CALLBACK(quitting_cb), NULL); | |
694 | |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
695 /* File transfer signals */ |
11281
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
696 gaim_signal_connect(ft_handle, "file-recv-accept", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
697 plugin, GAIM_CALLBACK(ft_recv_accept_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
698 gaim_signal_connect(ft_handle, "file-recv-start", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
699 plugin, GAIM_CALLBACK(ft_recv_start_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
700 gaim_signal_connect(ft_handle, "file-recv-cancel", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
701 plugin, GAIM_CALLBACK(ft_recv_cancel_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
702 gaim_signal_connect(ft_handle, "file-recv-complete", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
703 plugin, GAIM_CALLBACK(ft_recv_complete_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
704 gaim_signal_connect(ft_handle, "file-send-accept", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
705 plugin, GAIM_CALLBACK(ft_send_accept_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
706 gaim_signal_connect(ft_handle, "file-send-start", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
707 plugin, GAIM_CALLBACK(ft_send_start_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
708 gaim_signal_connect(ft_handle, "file-send-cancel", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
709 plugin, GAIM_CALLBACK(ft_send_cancel_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
710 gaim_signal_connect(ft_handle, "file-send-complete", |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
711 plugin, GAIM_CALLBACK(ft_send_complete_cb), NULL); |
920a37a4c1be
[gaim-migrate @ 13478]
Gary Kramlich <grim@reaperworld.com>
parents:
11256
diff
changeset
|
712 |
12291
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
713 /* Sound signals */ |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
714 gaim_signal_connect(sound_handle, "playing-sound-event", plugin, |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
715 GAIM_CALLBACK(sound_playing_event_cb), NULL); |
5bc3d67ceb24
[gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12216
diff
changeset
|
716 |
6485 | 717 return TRUE; |
718 } | |
719 | |
720 static GaimPluginInfo info = | |
721 { | |
9954 | 722 GAIM_PLUGIN_MAGIC, |
723 GAIM_MAJOR_VERSION, | |
724 GAIM_MINOR_VERSION, | |
6485 | 725 GAIM_PLUGIN_STANDARD, /**< type */ |
726 NULL, /**< ui_requirement */ | |
727 0, /**< flags */ | |
728 NULL, /**< dependencies */ | |
729 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
730 | |
731 SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
732 N_("Signals Test"), /**< name */ | |
733 VERSION, /**< version */ | |
734 /** summary */ | |
735 N_("Test to see that all signals are working properly."), | |
736 /** description */ | |
737 N_("Test to see that all signals are working properly."), | |
738 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
739 GAIM_WEBSITE, /**< homepage */ | |
740 | |
741 plugin_load, /**< load */ | |
11256
bb0d7b719af2
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11064
diff
changeset
|
742 NULL, /**< unload */ |
6485 | 743 NULL, /**< destroy */ |
744 | |
745 NULL, /**< ui_info */ | |
8993 | 746 NULL, /**< extra_info */ |
747 NULL, | |
748 NULL | |
6485 | 749 }; |
750 | |
751 static void | |
752 init_plugin(GaimPlugin *plugin) | |
753 { | |
754 } | |
755 | |
756 GAIM_INIT_PLUGIN(signalstest, init_plugin, info) |