Thu, 22 Apr 2004 01:53:18 +0000
[gaim-migrate @ 9504]
Bumped up the plugin API version number, and added version numbers for
loader plugins and protocol plugins. Authors will want to update their
plugins, and possibly use GAIM_PLUGIN_API_VERSION, GAIM_PRPL_API_VERSION,
and GAIM_LOADER_API_VERSION constants.
| 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 | ||
| 111 | /************************************************************************** | |
| 112 | * Connection subsystem signal callbacks | |
| 113 | **************************************************************************/ | |
| 114 | static void | |
| 115 | signing_on_cb(GaimConnection *gc, void *data) | |
| 116 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
117 | gaim_debug_misc("signals test", "signing-on (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
118 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 119 | } |
| 120 | ||
| 121 | static void | |
| 122 | signed_on_cb(GaimConnection *gc, void *data) | |
| 123 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
124 | gaim_debug_misc("signals test", "signed-on (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
125 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 126 | } |
| 127 | ||
| 128 | static void | |
| 129 | signing_off_cb(GaimConnection *gc, void *data) | |
| 130 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
131 | gaim_debug_misc("signals test", "signing-off (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
132 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 133 | } |
| 134 | ||
| 135 | static void | |
| 136 | signed_off_cb(GaimConnection *gc, void *data) | |
| 137 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
138 | gaim_debug_misc("signals test", "signed-off (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
139 | gaim_account_get_username(gaim_connection_get_account(gc))); |
| 6485 | 140 | } |
| 141 | ||
| 142 | /************************************************************************** | |
| 143 | * Conversation subsystem signal callbacks | |
| 144 | **************************************************************************/ | |
| 145 | static gboolean | |
| 7503 | 146 | displaying_im_msg_cb(GaimAccount *account, GaimConversation *conv, |
| 147 | char **buffer, void *data) | |
| 6485 | 148 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
149 | gaim_debug_misc("signals test", "displaying-im-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
150 | gaim_conversation_get_name(conv), *buffer); |
| 6485 | 151 | |
| 152 | return FALSE; | |
| 153 | } | |
| 154 | ||
| 155 | static void | |
| 156 | displayed_im_msg_cb(GaimConversation *conv, const char *buffer, void *data) | |
| 157 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
158 | gaim_debug_misc("signals test", "displayed-im-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
159 | gaim_conversation_get_name(conv), buffer); |
| 6485 | 160 | } |
| 161 | ||
| 7503 | 162 | static void |
| 6509 | 163 | sending_im_msg_cb(GaimAccount *account, char *recipient, char **buffer, void *data) |
| 6485 | 164 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
165 | 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
|
166 | gaim_account_get_username(account), recipient, *buffer); |
| 6485 | 167 | |
| 168 | } | |
| 169 | ||
| 170 | static void | |
| 6509 | 171 | sent_im_msg_cb(GaimAccount *account, const char *recipient, const char *buffer, void *data) |
| 6485 | 172 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
173 | 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
|
174 | gaim_account_get_username(account), recipient, buffer); |
| 6485 | 175 | } |
| 176 | ||
| 177 | static gboolean | |
| 6509 | 178 | received_im_msg_cb(GaimAccount *account, char **sender, char **buffer, |
| 179 | int *flags, void *data) | |
| 6485 | 180 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
181 | gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %d)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
182 | gaim_account_get_username(account), *sender, *buffer, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
183 | *flags); |
| 6485 | 184 | |
| 185 | return FALSE; | |
| 186 | } | |
| 187 | ||
| 188 | static gboolean | |
| 7503 | 189 | displaying_chat_msg_cb(GaimAccount *account, GaimConversation *conv, |
| 190 | char **buffer, void *data) | |
| 6485 | 191 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
192 | gaim_debug_misc("signals test", "displaying-chat-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
193 | gaim_conversation_get_name(conv), *buffer); |
| 6485 | 194 | |
|
6486
18da8fdbc85b
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
195 | return FALSE; |
| 6485 | 196 | } |
| 197 | ||
| 198 | static void | |
| 199 | displayed_chat_msg_cb(GaimConversation *conv, const char *buffer, void *data) | |
| 200 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
201 | gaim_debug_misc("signals test", "displayed-chat-msg (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
202 | gaim_conversation_get_name(conv), buffer); |
| 6485 | 203 | } |
| 204 | ||
| 205 | static gboolean | |
| 6509 | 206 | sending_chat_msg_cb(GaimAccount *account, char **buffer, int id, void *data) |
| 6485 | 207 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
208 | 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
|
209 | gaim_account_get_username(account), *buffer, id); |
| 6485 | 210 | |
| 211 | return FALSE; | |
| 212 | } | |
| 213 | ||
| 214 | static void | |
| 6509 | 215 | sent_chat_msg_cb(GaimAccount *account, const char *buffer, int id, void *data) |
| 6485 | 216 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
217 | 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
|
218 | gaim_account_get_username(account), buffer, id); |
| 6485 | 219 | } |
| 220 | ||
| 221 | static gboolean | |
| 6509 | 222 | received_chat_msg_cb(GaimAccount *account, char **sender, char **buffer, |
|
7516
d2d77f4f92fb
[gaim-migrate @ 8129]
Christian Hammond <chipx86@chipx86.com>
parents:
7503
diff
changeset
|
223 | GaimConversation *chat, void *data) |
| 6485 | 224 | { |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
225 | gaim_debug_misc("signals test", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
226 | "received-chat-msg (%s, %s, %s, %s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
227 | gaim_account_get_username(account), *sender, *buffer, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
228 | gaim_conversation_get_name(chat)); |
| 6485 | 229 | |
| 230 | return FALSE; | |
| 231 | } | |
| 232 | ||
| 233 | static void | |
| 234 | conversation_switching_cb(GaimConversation *old_conv, | |
| 235 | GaimConversation *new_conv, void *data) | |
| 236 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
237 | gaim_debug_misc("signals test", "conversation-switching (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
238 | gaim_conversation_get_name(old_conv), |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
239 | gaim_conversation_get_name(new_conv)); |
| 6485 | 240 | } |
| 241 | ||
| 242 | static void | |
| 243 | conversation_switched_cb(GaimConversation *old_conv, | |
| 244 | GaimConversation *new_conv, void *data) | |
| 245 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
246 | gaim_debug_misc("signals test", "conversation-switched (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
247 | gaim_conversation_get_name(old_conv), |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
248 | gaim_conversation_get_name(new_conv)); |
| 6485 | 249 | } |
| 250 | ||
| 251 | static void | |
| 252 | conversation_created_cb(GaimConversation *conv, void *data) | |
| 253 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
254 | gaim_debug_misc("signals test", "conversation-created (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
255 | gaim_conversation_get_name(conv)); |
| 6485 | 256 | } |
| 257 | ||
| 258 | static void | |
| 259 | deleting_conversation_cb(GaimConversation *conv, void *data) | |
| 260 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
261 | gaim_debug_misc("signals test", "deleting-conversation (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
262 | gaim_conversation_get_name(conv)); |
| 6485 | 263 | } |
| 264 | ||
| 265 | static void | |
| 266 | buddy_typing_cb(GaimConversation *conv, void *data) | |
| 267 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
268 | gaim_debug_misc("signals test", "buddy-typing (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
269 | gaim_conversation_get_name(conv)); |
| 6485 | 270 | } |
| 271 | ||
| 272 | static void | |
| 273 | chat_buddy_joining_cb(GaimConversation *conv, const char *user, void *data) | |
| 274 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
275 | gaim_debug_misc("signals test", "chat-buddy-joining (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
276 | gaim_conversation_get_name(conv), user); |
| 6485 | 277 | } |
| 278 | ||
| 279 | static void | |
| 280 | chat_buddy_joined_cb(GaimConversation *conv, const char *user, void *data) | |
| 281 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
282 | gaim_debug_misc("signals test", "chat-buddy-joined (%s, %s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
283 | gaim_conversation_get_name(conv), user); |
| 6485 | 284 | } |
| 285 | ||
| 286 | static void | |
| 287 | chat_buddy_leaving_cb(GaimConversation *conv, const char *user, | |
| 288 | const char *reason, void *data) | |
| 289 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
290 | 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
|
291 | gaim_conversation_get_name(conv), user, reason); |
| 6485 | 292 | } |
| 293 | ||
| 294 | static void | |
| 295 | chat_buddy_left_cb(GaimConversation *conv, const char *user, | |
| 296 | const char *reason, void *data) | |
| 297 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
298 | 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
|
299 | gaim_conversation_get_name(conv), user, reason); |
| 6485 | 300 | } |
| 301 | ||
| 302 | static void | |
| 303 | chat_inviting_user_cb(GaimConversation *conv, const char *name, | |
| 304 | const char *reason, void *data) | |
| 305 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
306 | 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
|
307 | gaim_conversation_get_name(conv), name, reason); |
| 6485 | 308 | } |
| 309 | ||
| 310 | static void | |
| 311 | chat_invited_user_cb(GaimConversation *conv, const char *name, | |
| 312 | const char *reason, void *data) | |
| 313 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
314 | 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
|
315 | gaim_conversation_get_name(conv), name, reason); |
| 6485 | 316 | } |
| 317 | ||
| 318 | static void | |
| 319 | chat_invited_cb(GaimAccount *account, const char *inviter, | |
| 320 | const char *room_name, const char *message, void *data) | |
| 321 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
322 | 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
|
323 | gaim_account_get_username(account), inviter, |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
324 | room_name, message); |
| 6485 | 325 | } |
| 326 | ||
| 327 | static void | |
| 328 | chat_joined_cb(GaimConversation *conv, void *data) | |
| 329 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
330 | gaim_debug_misc("signals test", "chat-joined (%s)\n", |
|
cda1bf7428a7
[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 | chat_left_cb(GaimConversation *conv, void *data) | |
| 336 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
337 | gaim_debug_misc("signals test", "chat-left (%s)\n", |
|
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
338 | gaim_conversation_get_name(conv)); |
| 6485 | 339 | } |
| 340 | ||
| 341 | /************************************************************************** | |
| 342 | * Core signal callbacks | |
| 343 | **************************************************************************/ | |
| 344 | static void | |
| 345 | quitting_cb(void *data) | |
| 346 | { | |
|
7517
cda1bf7428a7
[gaim-migrate @ 8130]
Christian Hammond <chipx86@chipx86.com>
parents:
7516
diff
changeset
|
347 | gaim_debug_misc("signals test", "quitting ()\n"); |
| 6485 | 348 | } |
| 349 | ||
| 350 | /************************************************************************** | |
| 351 | * Plugin stuff | |
| 352 | **************************************************************************/ | |
| 353 | static gboolean | |
| 354 | plugin_load(GaimPlugin *plugin) | |
| 355 | { | |
| 356 | void *core_handle = gaim_get_core(); | |
| 357 | void *blist_handle = gaim_blist_get_handle(); | |
| 358 | void *conn_handle = gaim_connections_get_handle(); | |
| 359 | void *conv_handle = gaim_conversations_get_handle(); | |
| 360 | void *accounts_handle = gaim_accounts_get_handle(); | |
| 361 | ||
| 362 | /* Accounts subsystem signals */ | |
| 363 | gaim_signal_connect(accounts_handle, "account-connecting", | |
| 364 | plugin, GAIM_CALLBACK(account_connecting_cb), NULL); | |
| 365 | gaim_signal_connect(accounts_handle, "account-away", | |
| 366 | plugin, GAIM_CALLBACK(account_away_cb), NULL); | |
| 367 | gaim_signal_connect(accounts_handle, "account-setting-info", | |
| 368 | plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); | |
| 369 | gaim_signal_connect(accounts_handle, "account-set-info", | |
| 370 | plugin, GAIM_CALLBACK(account_set_info_cb), NULL); | |
| 371 | gaim_signal_connect(accounts_handle, "account-warned", | |
| 372 | plugin, GAIM_CALLBACK(account_warned_cb), NULL); | |
| 373 | ||
| 374 | /* Buddy List subsystem signals */ | |
| 375 | gaim_signal_connect(blist_handle, "buddy-away", | |
| 376 | plugin, GAIM_CALLBACK(buddy_away_cb), NULL); | |
| 377 | gaim_signal_connect(blist_handle, "buddy-back", | |
| 378 | plugin, GAIM_CALLBACK(buddy_back_cb), NULL); | |
| 379 | gaim_signal_connect(blist_handle, "buddy-idle", | |
| 380 | plugin, GAIM_CALLBACK(buddy_idle_cb), NULL); | |
| 381 | gaim_signal_connect(blist_handle, "buddy-unidle", | |
| 382 | plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL); | |
| 383 | gaim_signal_connect(blist_handle, "buddy-signed-on", | |
| 384 | plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); | |
| 385 | gaim_signal_connect(blist_handle, "buddy-signed-off", | |
| 386 | plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); | |
| 387 | ||
| 388 | /* Connection subsystem signals */ | |
| 389 | gaim_signal_connect(conn_handle, "signing-on", | |
| 390 | plugin, GAIM_CALLBACK(signing_on_cb), NULL); | |
| 391 | gaim_signal_connect(conn_handle, "signed-on", | |
| 392 | plugin, GAIM_CALLBACK(signed_on_cb), NULL); | |
| 393 | gaim_signal_connect(conn_handle, "signing-off", | |
| 394 | plugin, GAIM_CALLBACK(signing_off_cb), NULL); | |
| 395 | gaim_signal_connect(conn_handle, "signed-off", | |
| 396 | plugin, GAIM_CALLBACK(signed_off_cb), NULL); | |
| 397 | ||
| 398 | /* Conversations subsystem signals */ | |
| 399 | gaim_signal_connect(conv_handle, "displaying-im-msg", | |
| 400 | plugin, GAIM_CALLBACK(displaying_im_msg_cb), NULL); | |
|
6489
4281626455d8
[gaim-migrate @ 7003]
Robert McQueen <robot101@debian.org>
parents:
6486
diff
changeset
|
401 | gaim_signal_connect(conv_handle, "displayed-im-msg", |
| 6485 | 402 | plugin, GAIM_CALLBACK(displayed_im_msg_cb), NULL); |
| 403 | gaim_signal_connect(conv_handle, "sending-im-msg", | |
| 404 | plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); | |
| 405 | gaim_signal_connect(conv_handle, "sent-im-msg", | |
| 406 | plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); | |
| 407 | gaim_signal_connect(conv_handle, "received-im-msg", | |
| 408 | plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); | |
| 409 | gaim_signal_connect(conv_handle, "displaying-chat-msg", | |
| 410 | plugin, GAIM_CALLBACK(displaying_chat_msg_cb), NULL); | |
| 411 | gaim_signal_connect(conv_handle, "displayed-chat-msg", | |
| 412 | plugin, GAIM_CALLBACK(displayed_chat_msg_cb), NULL); | |
| 413 | gaim_signal_connect(conv_handle, "sending-chat-msg", | |
| 414 | plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); | |
| 415 | gaim_signal_connect(conv_handle, "sent-chat-msg", | |
| 416 | plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); | |
| 417 | gaim_signal_connect(conv_handle, "received-chat-msg", | |
| 418 | plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); | |
| 419 | gaim_signal_connect(conv_handle, "conversation-switching", | |
| 420 | plugin, GAIM_CALLBACK(conversation_switching_cb), NULL); | |
| 421 | gaim_signal_connect(conv_handle, "conversation-switched", | |
| 422 | plugin, GAIM_CALLBACK(conversation_switched_cb), NULL); | |
| 423 | gaim_signal_connect(conv_handle, "conversation-created", | |
| 424 | plugin, GAIM_CALLBACK(conversation_created_cb), NULL); | |
| 425 | gaim_signal_connect(conv_handle, "deleting-conversation", | |
| 426 | plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); | |
| 427 | gaim_signal_connect(conv_handle, "buddy-typing", | |
| 428 | plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); | |
| 429 | gaim_signal_connect(conv_handle, "chat-buddy-joining", | |
| 430 | plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); | |
| 431 | gaim_signal_connect(conv_handle, "chat-buddy-joined", | |
| 432 | plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); | |
| 433 | gaim_signal_connect(conv_handle, "chat-buddy-leaving", | |
| 434 | plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); | |
| 435 | gaim_signal_connect(conv_handle, "chat-buddy-left", | |
| 436 | plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); | |
| 437 | gaim_signal_connect(conv_handle, "chat-inviting-user", | |
| 438 | plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); | |
| 439 | gaim_signal_connect(conv_handle, "chat-invited-user", | |
| 440 | plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); | |
| 441 | gaim_signal_connect(conv_handle, "chat-invited", | |
| 442 | plugin, GAIM_CALLBACK(chat_invited_cb), NULL); | |
| 443 | gaim_signal_connect(conv_handle, "chat-joined", | |
| 444 | plugin, GAIM_CALLBACK(chat_joined_cb), NULL); | |
| 445 | gaim_signal_connect(conv_handle, "chat-left", | |
| 446 | plugin, GAIM_CALLBACK(chat_left_cb), NULL); | |
| 447 | ||
| 448 | /* Core signals */ | |
| 449 | gaim_signal_connect(core_handle, "quitting", | |
| 450 | plugin, GAIM_CALLBACK(quitting_cb), NULL); | |
| 451 | ||
| 452 | return TRUE; | |
| 453 | } | |
| 454 | ||
| 455 | static GaimPluginInfo info = | |
| 456 | { | |
|
8749
fb487e9e101a
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
7517
diff
changeset
|
457 | GAIM_PLUGIN_API_VERSION, /**< api_version */ |
| 6485 | 458 | GAIM_PLUGIN_STANDARD, /**< type */ |
| 459 | NULL, /**< ui_requirement */ | |
| 460 | 0, /**< flags */ | |
| 461 | NULL, /**< dependencies */ | |
| 462 | GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 463 | ||
| 464 | SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
| 465 | N_("Signals Test"), /**< name */ | |
| 466 | VERSION, /**< version */ | |
| 467 | /** summary */ | |
| 468 | N_("Test to see that all signals are working properly."), | |
| 469 | /** description */ | |
| 470 | N_("Test to see that all signals are working properly."), | |
| 471 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
| 472 | GAIM_WEBSITE, /**< homepage */ | |
| 473 | ||
| 474 | plugin_load, /**< load */ | |
| 475 | NULL, /**< unload */ | |
| 476 | NULL, /**< destroy */ | |
| 477 | ||
| 478 | NULL, /**< ui_info */ | |
| 479 | NULL /**< extra_info */ | |
| 480 | }; | |
| 481 | ||
| 482 | static void | |
| 483 | init_plugin(GaimPlugin *plugin) | |
| 484 | { | |
| 485 | } | |
| 486 | ||
| 487 | GAIM_INIT_PLUGIN(signalstest, init_plugin, info) |