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