Sat, 22 May 2004 22:37:33 +0000
[gaim-migrate @ 9794]
I have a feeling returning act here is important.
| 6485 | 1 | /* |
| 2 | * Signals test plugin. | |
| 3 | * | |
| 4 | * Copyright (C) 2003 Christian Hammond. | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU General Public License as | |
| 8 | * published by the Free Software Foundation; either version 2 of the | |
| 9 | * License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, but | |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 19 | * 02111-1307, USA. | |
| 20 | */ | |
| 21 | #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" | |
| 22 | ||
| 23 | #include <stdio.h> | |
| 24 | ||
| 25 | #include "internal.h" | |
| 26 | #include "connection.h" | |
| 27 | #include "conversation.h" | |
| 28 | #include "core.h" | |
| 29 | #include "debug.h" | |
| 30 | #include "signals.h" | |
| 31 | ||
| 32 | /************************************************************************** | |
| 33 | * Account subsystem signal callbacks | |
| 34 | **************************************************************************/ | |
| 35 | static void | |
| 36 | account_connecting_cb(GaimAccount *account, void *data) | |
| 37 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
38 | gaim_debug_misc("signals test", "account-connecting (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
39 | gaim_account_get_username(account)); |
| 6485 | 40 | } |
| 41 | ||
| 42 | static void | |
| 43 | account_away_cb(GaimAccount *account, const char *state, | |
| 44 | const char *message, void *data) | |
| 45 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
46 | gaim_debug_misc("signals test", "account-away (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
47 | gaim_account_get_username(account), state, message); |
| 6485 | 48 | } |
| 49 | ||
| 50 | static void | |
| 51 | account_setting_info_cb(GaimAccount *account, const char *info, void *data) | |
| 52 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
53 | gaim_debug_misc("signals test", "account-setting-info (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
54 | gaim_account_get_username(account), info); |
| 6485 | 55 | } |
| 56 | ||
| 57 | static void | |
| 58 | account_set_info_cb(GaimAccount *account, const char *info, void *data) | |
| 59 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
60 | gaim_debug_misc("signals test", "account-set-info (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
61 | gaim_account_get_username(account), info); |
| 6485 | 62 | } |
| 63 | ||
| 64 | static void | |
| 65 | account_warned_cb(GaimAccount *account, const char *warner, int level, | |
| 66 | void *data) | |
| 67 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
68 | gaim_debug_misc("signals test", "account-warned (%s, %s, %d)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
69 | gaim_account_get_username(account), warner, level); |
| 6485 | 70 | } |
| 71 | ||
| 72 | /************************************************************************** | |
| 73 | * Buddy List subsystem signal callbacks | |
| 74 | **************************************************************************/ | |
| 75 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
76 | buddy_away_cb(GaimBuddy *buddy, void *data) |
| 6485 | 77 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
78 | gaim_debug_misc("signals test", "buddy-away (%s)\n", buddy->name); |
| 6485 | 79 | } |
| 80 | ||
| 81 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
82 | buddy_back_cb(GaimBuddy *buddy, void *data) |
| 6485 | 83 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
84 | gaim_debug_misc("signals test", "buddy-back (%s)\n", buddy->name); |
| 6485 | 85 | } |
| 86 | ||
| 87 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
88 | buddy_idle_cb(GaimBuddy *buddy, void *data) |
| 6485 | 89 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
90 | gaim_debug_misc("signals test", "buddy-idle (%s)\n", buddy->name); |
| 6485 | 91 | } |
| 92 | ||
| 93 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
94 | buddy_unidle_cb(GaimBuddy *buddy, void *data) |
| 6485 | 95 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
96 | gaim_debug_misc("signals test", "buddy-unidle (%s)\n", buddy->name); |
| 6485 | 97 | } |
| 98 | ||
| 99 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
100 | buddy_signed_on_cb(GaimBuddy *buddy, void *data) |
| 6485 | 101 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
102 | gaim_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); |
| 6485 | 103 | } |
| 104 | ||
| 105 | static void | |
|
7009
a5de8e4108fd
[gaim-migrate @ 7568]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
106 | buddy_signed_off_cb(GaimBuddy *buddy, void *data) |
| 6485 | 107 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
108 | gaim_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); |
| 6485 | 109 | } |
| 110 | ||
| 8999 | 111 | static void |
| 112 | buddy_extended_menu_cb(GaimBuddy *buddy, void *data) | |
| 113 | { | |
| 114 | gaim_debug_misc("signals test", "buddy-extended-menu (%s)\n", buddy->name); | |
| 115 | } | |
| 116 | ||
| 117 | static void | |
| 118 | group_extended_menu_cb(GaimGroup *group, void *data) | |
| 119 | { | |
| 120 | gaim_debug_misc("signals test", "group-extended-menu (%s)\n", group->name); | |
| 121 | } | |
| 122 | ||
| 123 | ||
| 6485 | 124 | /************************************************************************** |
| 125 | * Connection subsystem signal callbacks | |
| 126 | **************************************************************************/ | |
| 127 | static void | |
| 128 | signing_on_cb(GaimConnection *gc, void *data) | |
| 129 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
130 | gaim_debug_misc("signals test", "signing-on (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
131 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 132 | } |
| 133 | ||
| 134 | static void | |
| 135 | signed_on_cb(GaimConnection *gc, void *data) | |
| 136 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
137 | gaim_debug_misc("signals test", "signed-on (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
138 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 139 | } |
| 140 | ||
| 141 | static void | |
| 142 | signing_off_cb(GaimConnection *gc, void *data) | |
| 143 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
144 | gaim_debug_misc("signals test", "signing-off (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
145 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 146 | } |
| 147 | ||
| 148 | static void | |
| 149 | signed_off_cb(GaimConnection *gc, void *data) | |
| 150 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
151 | gaim_debug_misc("signals test", "signed-off (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
152 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 153 | } |
| 154 | ||
| 155 | /************************************************************************** | |
| 156 | * Conversation subsystem signal callbacks | |
| 157 | **************************************************************************/ | |
| 158 | static gboolean | |
| 7503 | 159 | displaying_im_msg_cb(GaimAccount *account, GaimConversation *conv, |
| 160 | char **buffer, void *data) | |
| 6485 | 161 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
162 | gaim_debug_misc("signals test", "displaying-im-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
163 | gaim_conversation_get_name(conv), *buffer); |
| 6485 | 164 | |
| 165 | return FALSE; | |
| 166 | } | |
| 167 | ||
| 168 | static void | |
| 169 | displayed_im_msg_cb(GaimConversation *conv, const char *buffer, void *data) | |
| 170 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
171 | gaim_debug_misc("signals test", "displayed-im-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
172 | gaim_conversation_get_name(conv), buffer); |
| 6485 | 173 | } |
| 174 | ||
| 7503 | 175 | static void |
| 6509 | 176 | sending_im_msg_cb(GaimAccount *account, char *recipient, char **buffer, void *data) |
| 6485 | 177 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
178 | gaim_debug_misc("signals test", "sending-im-msg (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
179 | gaim_account_get_username(account), recipient, *buffer); |
| 6485 | 180 | |
| 181 | } | |
| 182 | ||
| 183 | static void | |
| 6509 | 184 | sent_im_msg_cb(GaimAccount *account, const char *recipient, const char *buffer, void *data) |
| 6485 | 185 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
186 | gaim_debug_misc("signals test", "sent-im-msg (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
187 | gaim_account_get_username(account), recipient, buffer); |
| 6485 | 188 | } |
| 189 | ||
| 190 | static gboolean | |
| 8999 | 191 | receiving_im_msg_cb(GaimAccount *account, char **sender, char **buffer, |
| 6509 | 192 | int *flags, void *data) |
| 6485 | 193 | { |
| 8999 | 194 | gaim_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %d)\n", |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
195 | gaim_account_get_username(account), *sender, *buffer, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
196 | *flags); |
| 6485 | 197 | |
| 198 | return FALSE; | |
| 199 | } | |
| 200 | ||
| 8999 | 201 | static void |
| 202 | received_im_msg_cb(GaimAccount *account, char *sender, char *buffer, | |
| 203 | int flags, void *data) | |
| 204 | { | |
| 205 | gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %d)\n", | |
| 206 | gaim_account_get_username(account), sender, buffer, | |
| 207 | flags); | |
| 208 | } | |
| 209 | ||
| 6485 | 210 | static gboolean |
| 7503 | 211 | displaying_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
| 212 | char **buffer, void *data) | |
| 6485 | 213 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
214 | gaim_debug_misc("signals test", "displaying-chat-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
215 | gaim_conversation_get_name(conv), *buffer); |
| 6485 | 216 | |
|
6486
18da8fdbc85b
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
217 | return FALSE; |
| 6485 | 218 | } |
| 219 | ||
| 220 | static void | |
| 221 | displayed_chat_msg_cb(GaimConversation *conv, const char *buffer, void *data) | |
| 222 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
223 | gaim_debug_misc("signals test", "displayed-chat-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
224 | gaim_conversation_get_name(conv), buffer); |
| 6485 | 225 | } |
| 226 | ||
| 227 | static gboolean | |
| 6509 | 228 | sending_chat_msg_cb(GaimAccount *account, char **buffer, int id, void *data) |
| 6485 | 229 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
230 | gaim_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
231 | gaim_account_get_username(account), *buffer, id); |
| 6485 | 232 | |
| 233 | return FALSE; | |
| 234 | } | |
| 235 | ||
| 236 | static void | |
| 6509 | 237 | sent_chat_msg_cb(GaimAccount *account, const char *buffer, int id, void *data) |
| 6485 | 238 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
239 | gaim_debug_misc("signals test", "sent-chat-msg (%s, %s, %d)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
240 | gaim_account_get_username(account), buffer, id); |
| 6485 | 241 | } |
| 242 | ||
| 243 | static gboolean | |
| 8999 | 244 | receiving_chat_msg_cb(GaimAccount *account, char **sender, char **buffer, |
|
7516
d2d77f4f92fb
[gaim-migrate @ 8129]
Christian Hammond <chipx86@chipx86.com>
parents:
7503
diff
changeset
|
245 | GaimConversation *chat, void *data) |
| 6485 | 246 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
247 | gaim_debug_misc("signals test", |
| 8999 | 248 | "receiving-chat-msg (%s, %s, %s, %s)\n", |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
249 | gaim_account_get_username(account), *sender, *buffer, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
250 | gaim_conversation_get_name(chat)); |
| 6485 | 251 | |
| 252 | return FALSE; | |
| 253 | } | |
| 254 | ||
| 255 | static void | |
| 8999 | 256 | received_chat_msg_cb(GaimAccount *account, char *sender, char *buffer, |
| 257 | GaimConversation *chat, void *data) | |
| 258 | { | |
| 259 | gaim_debug_misc("signals test", | |
| 260 | "received-chat-msg (%s, %s, %s, %s)\n", | |
| 261 | gaim_account_get_username(account), sender, buffer, | |
| 262 | gaim_conversation_get_name(chat)); | |
| 263 | } | |
| 264 | ||
| 265 | static void | |
| 6485 | 266 | conversation_switching_cb(GaimConversation *old_conv, |
| 267 | GaimConversation *new_conv, void *data) | |
| 268 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
269 | gaim_debug_misc("signals test", "conversation-switching (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
270 | gaim_conversation_get_name(old_conv), |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
271 | gaim_conversation_get_name(new_conv)); |
| 6485 | 272 | } |
| 273 | ||
| 274 | static void | |
| 275 | conversation_switched_cb(GaimConversation *old_conv, | |
| 276 | GaimConversation *new_conv, void *data) | |
| 277 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
278 | gaim_debug_misc("signals test", "conversation-switched (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
279 | gaim_conversation_get_name(old_conv), |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
280 | gaim_conversation_get_name(new_conv)); |
| 6485 | 281 | } |
| 282 | ||
| 283 | static void | |
| 284 | conversation_created_cb(GaimConversation *conv, void *data) | |
| 285 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
286 | gaim_debug_misc("signals test", "conversation-created (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
287 | gaim_conversation_get_name(conv)); |
| 6485 | 288 | } |
| 289 | ||
| 290 | static void | |
| 291 | deleting_conversation_cb(GaimConversation *conv, void *data) | |
| 292 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
293 | gaim_debug_misc("signals test", "deleting-conversation (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
294 | gaim_conversation_get_name(conv)); |
| 6485 | 295 | } |
| 296 | ||
| 297 | static void | |
| 298 | buddy_typing_cb(GaimConversation *conv, void *data) | |
| 299 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
300 | gaim_debug_misc("signals test", "buddy-typing (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
301 | gaim_conversation_get_name(conv)); |
| 6485 | 302 | } |
| 303 | ||
| 304 | static void | |
| 305 | chat_buddy_joining_cb(GaimConversation *conv, const char *user, void *data) | |
| 306 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
307 | gaim_debug_misc("signals test", "chat-buddy-joining (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
308 | gaim_conversation_get_name(conv), user); |
| 6485 | 309 | } |
| 310 | ||
| 311 | static void | |
| 312 | chat_buddy_joined_cb(GaimConversation *conv, const char *user, void *data) | |
| 313 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
314 | gaim_debug_misc("signals test", "chat-buddy-joined (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
315 | gaim_conversation_get_name(conv), user); |
| 6485 | 316 | } |
| 317 | ||
| 318 | static void | |
| 319 | chat_buddy_leaving_cb(GaimConversation *conv, const char *user, | |
| 320 | const char *reason, void *data) | |
| 321 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
322 | gaim_debug_misc("signals test", "chat-buddy-leaving (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
323 | gaim_conversation_get_name(conv), user, reason); |
| 6485 | 324 | } |
| 325 | ||
| 326 | static void | |
| 327 | chat_buddy_left_cb(GaimConversation *conv, const char *user, | |
| 328 | const char *reason, void *data) | |
| 329 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
330 | gaim_debug_misc("signals test", "chat-buddy-left (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
331 | gaim_conversation_get_name(conv), user, reason); |
| 6485 | 332 | } |
| 333 | ||
| 334 | static void | |
| 335 | chat_inviting_user_cb(GaimConversation *conv, const char *name, | |
| 336 | const char *reason, void *data) | |
| 337 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
338 | gaim_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
339 | gaim_conversation_get_name(conv), name, reason); |
| 6485 | 340 | } |
| 341 | ||
| 342 | static void | |
| 343 | chat_invited_user_cb(GaimConversation *conv, const char *name, | |
| 344 | const char *reason, void *data) | |
| 345 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
346 | gaim_debug_misc("signals test", "chat-invited-user (%s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
347 | gaim_conversation_get_name(conv), name, reason); |
| 6485 | 348 | } |
| 349 | ||
| 350 | static void | |
| 351 | chat_invited_cb(GaimAccount *account, const char *inviter, | |
| 352 | const char *room_name, const char *message, void *data) | |
| 353 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
354 | gaim_debug_misc("signals test", "chat-invited (%s, %s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
355 | gaim_account_get_username(account), inviter, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
356 | room_name, message); |
| 6485 | 357 | } |
| 358 | ||
| 359 | static void | |
| 360 | chat_joined_cb(GaimConversation *conv, void *data) | |
| 361 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
362 | gaim_debug_misc("signals test", "chat-joined (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
363 | gaim_conversation_get_name(conv)); |
| 6485 | 364 | } |
| 365 | ||
| 366 | static void | |
| 367 | chat_left_cb(GaimConversation *conv, void *data) | |
| 368 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
369 | gaim_debug_misc("signals test", "chat-left (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
370 | gaim_conversation_get_name(conv)); |
| 6485 | 371 | } |
| 372 | ||
| 373 | /************************************************************************** | |
| 374 | * Core signal callbacks | |
| 375 | **************************************************************************/ | |
| 376 | static void | |
| 377 | quitting_cb(void *data) | |
| 378 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
379 | gaim_debug_misc("signals test", "quitting ()\n"); |
| 6485 | 380 | } |
| 381 | ||
| 382 | /************************************************************************** | |
| 383 | * Plugin stuff | |
| 384 | **************************************************************************/ | |
| 385 | static gboolean | |
| 386 | plugin_load(GaimPlugin *plugin) | |
| 387 | { | |
| 388 | void *core_handle = gaim_get_core(); | |
| 389 | void *blist_handle = gaim_blist_get_handle(); | |
| 390 | void *conn_handle = gaim_connections_get_handle(); | |
| 391 | void *conv_handle = gaim_conversations_get_handle(); | |
| 392 | void *accounts_handle = gaim_accounts_get_handle(); | |
| 393 | ||
| 394 | /* Accounts subsystem signals */ | |
| 395 | gaim_signal_connect(accounts_handle, "account-connecting", | |
| 396 | plugin, GAIM_CALLBACK(account_connecting_cb), NULL); | |
| 397 | gaim_signal_connect(accounts_handle, "account-away", | |
| 398 | plugin, GAIM_CALLBACK(account_away_cb), NULL); | |
| 399 | gaim_signal_connect(accounts_handle, "account-setting-info", | |
| 400 | plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); | |
| 401 | gaim_signal_connect(accounts_handle, "account-set-info", | |
| 402 | plugin, GAIM_CALLBACK(account_set_info_cb), NULL); | |
| 403 | gaim_signal_connect(accounts_handle, "account-warned", | |
| 404 | plugin, GAIM_CALLBACK(account_warned_cb), NULL); | |
| 405 | ||
| 406 | /* Buddy List subsystem signals */ | |
| 407 | gaim_signal_connect(blist_handle, "buddy-away", | |
| 408 | plugin, GAIM_CALLBACK(buddy_away_cb), NULL); | |
| 409 | gaim_signal_connect(blist_handle, "buddy-back", | |
| 410 | plugin, GAIM_CALLBACK(buddy_back_cb), NULL); | |
| 411 | gaim_signal_connect(blist_handle, "buddy-idle", | |
| 412 | plugin, GAIM_CALLBACK(buddy_idle_cb), NULL); | |
| 413 | gaim_signal_connect(blist_handle, "buddy-unidle", | |
| 414 | plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL); | |
| 415 | gaim_signal_connect(blist_handle, "buddy-signed-on", | |
| 416 | plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); | |
| 417 | gaim_signal_connect(blist_handle, "buddy-signed-off", | |
| 418 | plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); | |
| 8999 | 419 | gaim_signal_connect(blist_handle, "buddy-extended-menu", |
| 420 | plugin, GAIM_CALLBACK(buddy_extended_menu_cb), NULL); | |
| 421 | gaim_signal_connect(blist_handle, "group-extended-menu", | |
| 422 | plugin, GAIM_CALLBACK(group_extended_menu_cb), NULL); | |
| 6485 | 423 | |
| 424 | /* Connection subsystem signals */ | |
| 425 | gaim_signal_connect(conn_handle, "signing-on", | |
| 426 | plugin, GAIM_CALLBACK(signing_on_cb), NULL); | |
| 427 | gaim_signal_connect(conn_handle, "signed-on", | |
| 428 | plugin, GAIM_CALLBACK(signed_on_cb), NULL); | |
| 429 | gaim_signal_connect(conn_handle, "signing-off", | |
| 430 | plugin, GAIM_CALLBACK(signing_off_cb), NULL); | |
| 431 | gaim_signal_connect(conn_handle, "signed-off", | |
| 432 | plugin, GAIM_CALLBACK(signed_off_cb), NULL); | |
| 433 | ||
| 434 | /* Conversations subsystem signals */ | |
| 435 | gaim_signal_connect(conv_handle, "displaying-im-msg", | |
| 436 | plugin, GAIM_CALLBACK(displaying_im_msg_cb), NULL); | |
|
6489
4281626455d8
[gaim-migrate @ 7003]
Robert McQueen <robot101@debian.org>
parents:
6486
diff
changeset
|
437 | gaim_signal_connect(conv_handle, "displayed-im-msg", |
| 6485 | 438 | plugin, GAIM_CALLBACK(displayed_im_msg_cb), NULL); |
| 439 | gaim_signal_connect(conv_handle, "sending-im-msg", | |
| 440 | plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); | |
| 441 | gaim_signal_connect(conv_handle, "sent-im-msg", | |
| 442 | plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); | |
| 8999 | 443 | gaim_signal_connect(conv_handle, "receiving-im-msg", |
| 444 | plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); | |
| 6485 | 445 | gaim_signal_connect(conv_handle, "received-im-msg", |
| 446 | plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); | |
| 447 | gaim_signal_connect(conv_handle, "displaying-chat-msg", | |
| 448 | plugin, GAIM_CALLBACK(displaying_chat_msg_cb), NULL); | |
| 449 | gaim_signal_connect(conv_handle, "displayed-chat-msg", | |
| 450 | plugin, GAIM_CALLBACK(displayed_chat_msg_cb), NULL); | |
| 451 | gaim_signal_connect(conv_handle, "sending-chat-msg", | |
| 452 | plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); | |
| 453 | gaim_signal_connect(conv_handle, "sent-chat-msg", | |
| 454 | plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); | |
| 8999 | 455 | gaim_signal_connect(conv_handle, "receiving-chat-msg", |
| 456 | plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL); | |
| 6485 | 457 | gaim_signal_connect(conv_handle, "received-chat-msg", |
| 458 | plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); | |
| 459 | gaim_signal_connect(conv_handle, "conversation-switching", | |
| 460 | plugin, GAIM_CALLBACK(conversation_switching_cb), NULL); | |
| 461 | gaim_signal_connect(conv_handle, "conversation-switched", | |
| 462 | plugin, GAIM_CALLBACK(conversation_switched_cb), NULL); | |
| 463 | gaim_signal_connect(conv_handle, "conversation-created", | |
| 464 | plugin, GAIM_CALLBACK(conversation_created_cb), NULL); | |
| 465 | gaim_signal_connect(conv_handle, "deleting-conversation", | |
| 466 | plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); | |
| 467 | gaim_signal_connect(conv_handle, "buddy-typing", | |
| 468 | plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); | |
| 469 | gaim_signal_connect(conv_handle, "chat-buddy-joining", | |
| 470 | plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); | |
| 471 | gaim_signal_connect(conv_handle, "chat-buddy-joined", | |
| 472 | plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); | |
| 473 | gaim_signal_connect(conv_handle, "chat-buddy-leaving", | |
| 474 | plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); | |
| 475 | gaim_signal_connect(conv_handle, "chat-buddy-left", | |
| 476 | plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); | |
| 477 | gaim_signal_connect(conv_handle, "chat-inviting-user", | |
| 478 | plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); | |
| 479 | gaim_signal_connect(conv_handle, "chat-invited-user", | |
| 480 | plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); | |
| 481 | gaim_signal_connect(conv_handle, "chat-invited", | |
| 482 | plugin, GAIM_CALLBACK(chat_invited_cb), NULL); | |
| 483 | gaim_signal_connect(conv_handle, "chat-joined", | |
| 484 | plugin, GAIM_CALLBACK(chat_joined_cb), NULL); | |
| 485 | gaim_signal_connect(conv_handle, "chat-left", | |
| 486 | plugin, GAIM_CALLBACK(chat_left_cb), NULL); | |
| 487 | ||
| 488 | /* Core signals */ | |
| 489 | gaim_signal_connect(core_handle, "quitting", | |
| 490 | plugin, GAIM_CALLBACK(quitting_cb), NULL); | |
| 491 | ||
| 492 | return TRUE; | |
| 493 | } | |
| 494 | ||
| 495 | static GaimPluginInfo info = | |
| 496 | { | |
|
8749
fb487e9e101a
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
7517
diff
changeset
|
497 | GAIM_PLUGIN_API_VERSION, /**< api_version */ |
| 6485 | 498 | GAIM_PLUGIN_STANDARD, /**< type */ |
| 499 | NULL, /**< ui_requirement */ | |
| 500 | 0, /**< flags */ | |
| 501 | NULL, /**< dependencies */ | |
| 502 | GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 503 | ||
| 504 | SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
| 505 | N_("Signals Test"), /**< name */ | |
| 506 | VERSION, /**< version */ | |
| 507 | /** summary */ | |
| 508 | N_("Test to see that all signals are working properly."), | |
| 509 | /** description */ | |
| 510 | N_("Test to see that all signals are working properly."), | |
| 511 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
| 512 | GAIM_WEBSITE, /**< homepage */ | |
| 513 | ||
| 514 | plugin_load, /**< load */ | |
| 515 | NULL, /**< unload */ | |
| 516 | NULL, /**< destroy */ | |
| 517 | ||
| 518 | NULL, /**< ui_info */ | |
| 8993 | 519 | NULL, /**< extra_info */ |
| 520 | NULL, | |
| 521 | NULL | |
| 6485 | 522 | }; |
| 523 | ||
| 524 | static void | |
| 525 | init_plugin(GaimPlugin *plugin) | |
| 526 | { | |
| 527 | } | |
| 528 | ||
| 529 | GAIM_INIT_PLUGIN(signalstest, init_plugin, info) |