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