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