comparison plugins/SIGNALS @ 2345:a49e8f1afbc4

[gaim-migrate @ 2358] you say potato, i say potato you say tomato, i say tomato potato, potato tomato, tomato let's call the whole thing off. *sigh*. it just doesn't work as well when it's typed. but you wouldn't want to hear me sing it. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 22 Sep 2001 09:14:27 +0000
parents 0b5c3338fa3d
children ad56a93661fc
comparison
equal deleted inserted replaced
2344:19ea44f74a88 2345:a49e8f1afbc4
18 event_chat_buddy_join, 18 event_chat_buddy_join,
19 event_chat_buddy_leave, 19 event_chat_buddy_leave,
20 event_chat_recv, 20 event_chat_recv,
21 event_chat_send, 21 event_chat_send,
22 event_warned, 22 event_warned,
23 event_error,
24 event_quit, 23 event_quit,
25 event_new_conversation, 24 event_new_conversation,
26 event_set_info, 25 event_set_info,
27 event_draw_menu, 26 event_draw_menu,
28 event_im_displayed_sent, 27 event_im_displayed_sent,
29 event_im_displayed_rcvd 28 event_im_displayed_rcvd,
29 event_chat_send_invite
30 }; 30 };
31 31
32 To add a signal handler, call the fuction gaim_signal_connect with the 32 To add a signal handler, call the fuction gaim_signal_connect with the
33 following arguments: 33 following arguments:
34 34
169 'room' is the room they invited you to. 169 'room' is the room they invited you to.
170 'message' is the (optional) message they sent to invite you, and may be 170 'message' is the (optional) message they sent to invite you, and may be
171 an empty string. 171 an empty string.
172 172
173 event_chat_join: 173 event_chat_join:
174 struct gaim_connection *gc, char *room 174 struct gaim_connection *gc, int id, char *room
175 175
176 'gc' is the connection that joined the room. 176 'gc' is the connection that joined the room.
177 'id' is the id of the room. See, each room is given an id unique
178 within the connection. The struct conversation*'s in gc->buddy_chats
179 have an 'id' field that's only used if it's is_chat member is TRUE.
180 'id' is the *only* way to detect which chat room you actually mean,
181 because the name of the chat room is not always unique (for example,
182 MSN always uses "MSN Chat" as its name, since group chats in MSN
183 don't actually have names).
177 'room' is the chat room that you have just joined. 184 'room' is the chat room that you have just joined.
178 185
179 event_chat_leave: 186 event_chat_leave:
180 struct gaim_connection *gc, char *room 187 struct gaim_connection *gc, int
181 188
182 'gc' is the connection that joined the room. 189 'gc' is the connection that joined the room.
183 'room' is the chat room that you have just left. 190 'id' is the id of the chat room that you have just left.
184 191
185 event_chat_buddy_join: 192 event_chat_buddy_join:
186 struct gaim_connection *gc, char *room, char *who 193 struct gaim_connection *gc, int id, char *who
187 194
188 'gc' is the connection that the chat room is attached to. 195 'gc' is the connection that the chat room is attached to.
189 'room' is the room the person joined. 196 'id' is the id of the room the person joined.
190 'who' is the screenname of the person who joined. 197 'who' is the screenname of the person who joined.
191 198
192 This is also triggered upon entering the room for every person in the 199 This is also triggered upon entering the room for every person in the
193 room, including yourself. (E.g. if you join a room that already had 3 200 room, including yourself. (E.g. if you join a room that already had 3
194 people in it this will be called 4 times, once for each of them and 201 people in it this will be called 4 times, once for each of them and
195 once again for you. You will not always be the last one this is called 202 once again for you. You will not always be the last one this is called
196 for though.) 203 for though.)
197 204
198 event_chat_buddy_leave: 205 event_chat_buddy_leave:
199 struct gaim_connection *gc, char *room, char *who 206 struct gaim_connection *gc, int id, char *who
200 207
201 'gc' is the connection that the chat room is attached to. 208 'gc' is the connection that the chat room is attached to.
202 'room' is the room the person left. 209 'id' is the id of the room the person left.
203 'who' is the screenname of the person who left. 210 'who' is the screenname of the person who left.
204 211
205 event_chat_recv: 212 event_chat_recv:
206 struct gaim_connection *gc, char *room, char *who, char *text 213 struct gaim_connection *gc, int id, char *who, char *text
207 214
208 'gc' is the connection that received the message. 215 'gc' is the connection that received the message.
209 'room' should be obvious by now.
210 'who' should be too. 216 'who' should be too.
211 'text' is the message that got sent. 217 'text' is the message that got sent.
218 'id' is the id of the room that received the message (see
219 event_chat_join)
212 220
213 Note that because of the bizarre way chat works, you also receive 221 Note that because of the bizarre way chat works, you also receive
214 messages that you send. I didn't design it, AOL did. 222 messages that you send. I didn't design it, AOL did.
215 223
216 event_chat_send: 224 event_chat_send:
217 struct gaim_connection *gc, char *room, char **text 225 struct gaim_connection *gc, int id, char **text
218 226
219 'gc' is the connection that the message is about to be sent on. 227 'gc' is the connection that the message is about to be sent on.
220 'room'. Need I say more. 228 'id' is the id of the room to which you're sending the message.
221 'text' is what you're about to say, linkified/HTML-ized, but not 229 'text' is what you're about to say, linkified/HTML-ized, but not
222 TOC-escaped. 230 TOC-escaped.
223 231
224 Be aware that you receive messages you send (as noted above). This 232 Be aware that you receive messages you send (as noted above). This
225 event will be called before you actually send the message though. 233 event will be called before you actually send the message though.
231 239
232 'gc' is the account that got warned. 240 'gc' is the account that got warned.
233 'who' is who warned you. Note that this can be NULL, indicating either 241 'who' is who warned you. Note that this can be NULL, indicating either
234 an anonymous warning, or your warning level has dropped. 242 an anonymous warning, or your warning level has dropped.
235 'level' is your new warning level. 243 'level' is your new warning level.
236
237 event_error:
238 int error
239
240 'error' is the number of the error as defined by the TOC PROTOCOL
241 document, which can be found in the docs/ directory of the source
242 tree. Note that if the person is using Oscar, this number is often
243 plain wrong, and this event may not always be triggered on error.
244 Experiment to find what is reliable.
245 244
246 event_quit: 245 event_quit:
247 (none) 246 (none)
248 247
249 Called when gaim quits normally. This can be called from either the 248 Called when gaim quits normally. This can be called from either the
300 299
301 'gc' is the connection the message was received on. 300 'gc' is the connection the message was received on.
302 'who' is who sent the message. 301 'who' is who sent the message.
303 'what' is what was sent. 302 'what' is what was sent.
304 'flags' is flags on the message. 303 'flags' is flags on the message.
304
305 event_chat_send_invite:
306 struct gaim_connection *gc, int id, char *who, char *msg
307
308 This is called just before you're about to invite someone. It's
309 useful for if you want to pass someone a key so that they can
310 participate in a group encrypted chat (ahem).
311
312 'gc' is the connection the invite is sent on.
313 'id' is the id of the room you're inviting them to.
314 'who' is who you're inviting.
315 'msg' is the message they'll receive when they're invited.