13234
|
1 /*
|
|
2 * Gaim's oscar protocol plugin
|
|
3 * This file is the legal property of its developers.
|
|
4 * Please see the AUTHORS file distributed alongside this file.
|
|
5 *
|
|
6 * This library is free software; you can redistribute it and/or
|
|
7 * modify it under the terms of the GNU Lesser General Public
|
|
8 * License as published by the Free Software Foundation; either
|
|
9 * version 2 of the License, or (at your option) any later version.
|
|
10 *
|
|
11 * This library is distributed in the hope that it will be useful,
|
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14 * Lesser General Public License for more details.
|
|
15 *
|
|
16 * You should have received a copy of the GNU Lesser General Public
|
|
17 * License along with this library; if not, write to the Free Software
|
|
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19 */
|
|
20
|
|
21 /*
|
|
22 * Family 0x000e - Routines for the Chat service.
|
|
23 *
|
|
24 */
|
|
25
|
|
26 #include "oscar.h"
|
|
27
|
|
28 #include <string.h>
|
|
29
|
|
30 /* Stored in the ->internal of chat connections */
|
13592
|
31 struct chatconnpriv
|
|
32 {
|
13234
|
33 guint16 exchange;
|
|
34 char *name;
|
|
35 guint16 instance;
|
|
36 };
|
|
37
|
13592
|
38 void
|
|
39 flap_connection_destroy_chat(OscarData *od, FlapConnection *conn)
|
13234
|
40 {
|
|
41 struct chatconnpriv *ccp = (struct chatconnpriv *)conn->internal;
|
|
42
|
|
43 if (ccp)
|
|
44 free(ccp->name);
|
|
45 free(ccp);
|
|
46
|
|
47 return;
|
|
48 }
|
|
49
|
13592
|
50 char *
|
|
51 aim_chat_getname(FlapConnection *conn)
|
13234
|
52 {
|
|
53 struct chatconnpriv *ccp;
|
|
54
|
|
55 if (!conn)
|
|
56 return NULL;
|
|
57
|
13592
|
58 if (conn->type != SNAC_FAMILY_CHAT)
|
13234
|
59 return NULL;
|
|
60
|
|
61 ccp = (struct chatconnpriv *)conn->internal;
|
|
62
|
|
63 return ccp->name;
|
|
64 }
|
|
65
|
|
66 /* XXX get this into conn.c -- evil!! */
|
13592
|
67 FlapConnection *
|
|
68 aim_chat_getconn(OscarData *od, const char *name)
|
13234
|
69 {
|
13254
|
70 GList *cur;
|
13234
|
71
|
13592
|
72 for (cur = od->oscar_connections; cur; cur = cur->next)
|
13254
|
73 {
|
13592
|
74 FlapConnection *conn;
|
13254
|
75 struct chatconnpriv *ccp;
|
13234
|
76
|
13254
|
77 conn = cur->data;
|
|
78 ccp = (struct chatconnpriv *)conn->internal;
|
|
79
|
13592
|
80 if (conn->type != SNAC_FAMILY_CHAT)
|
13234
|
81 continue;
|
13254
|
82 if (!conn->internal) {
|
|
83 gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", conn->fd);
|
13234
|
84 continue;
|
|
85 }
|
|
86
|
|
87 if (strcmp(ccp->name, name) == 0)
|
13254
|
88 return conn;;
|
13234
|
89 }
|
|
90
|
13254
|
91 return NULL;
|
13234
|
92 }
|
|
93
|
13592
|
94 int
|
|
95 aim_chat_attachname(FlapConnection *conn, guint16 exchange, const char *roomname, guint16 instance)
|
13234
|
96 {
|
|
97 struct chatconnpriv *ccp;
|
|
98
|
|
99 if (!conn || !roomname)
|
|
100 return -EINVAL;
|
|
101
|
|
102 if (conn->internal)
|
|
103 free(conn->internal);
|
|
104
|
13592
|
105 ccp = g_new(struct chatconnpriv, 1);
|
13234
|
106
|
|
107 ccp->exchange = exchange;
|
|
108 ccp->name = strdup(roomname);
|
|
109 ccp->instance = instance;
|
|
110
|
|
111 conn->internal = (void *)ccp;
|
|
112
|
|
113 return 0;
|
|
114 }
|
|
115
|
13592
|
116 int
|
|
117 aim_chat_readroominfo(ByteStream *bs, struct aim_chat_roominfo *outinfo)
|
13234
|
118 {
|
|
119 int namelen;
|
|
120
|
|
121 if (!bs || !outinfo)
|
|
122 return 0;
|
|
123
|
13592
|
124 outinfo->exchange = byte_stream_get16(bs);
|
|
125 namelen = byte_stream_get8(bs);
|
|
126 outinfo->name = byte_stream_getstr(bs, namelen);
|
|
127 outinfo->instance = byte_stream_get16(bs);
|
13234
|
128
|
|
129 return 0;
|
|
130 }
|
|
131
|
13592
|
132 int
|
|
133 aim_chat_leaveroom(OscarData *od, const char *name)
|
13234
|
134 {
|
13592
|
135 FlapConnection *conn;
|
13234
|
136
|
13592
|
137 if (!(conn = aim_chat_getconn(od, name)))
|
13234
|
138 return -ENOENT;
|
|
139
|
13592
|
140 flap_connection_close(od, conn);
|
13234
|
141
|
|
142 return 0;
|
|
143 }
|
|
144
|
|
145 /*
|
|
146 * Subtype 0x0002 - General room information. Lots of stuff.
|
|
147 *
|
|
148 * Values I know are in here but I haven't attached
|
|
149 * them to any of the 'Unknown's:
|
|
150 * - Language (English)
|
|
151 *
|
|
152 */
|
13592
|
153 static int
|
|
154 infoupdate(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
|
13234
|
155 {
|
|
156 aim_userinfo_t *userinfo = NULL;
|
|
157 aim_rxcallback_t userfunc;
|
|
158 int ret = 0;
|
13652
|
159 int usercount;
|
13234
|
160 guint8 detaillevel = 0;
|
13652
|
161 char *roomname;
|
13234
|
162 struct aim_chat_roominfo roominfo;
|
|
163 guint16 tlvcount = 0;
|
|
164 aim_tlvlist_t *tlvlist;
|
13652
|
165 aim_tlv_t *tlv;
|
|
166 char *roomdesc;
|
|
167 guint16 flags;
|
|
168 guint32 creationtime;
|
|
169 guint16 maxmsglen, maxvisiblemsglen;
|
|
170 guint16 unknown_d2, unknown_d5;
|
13234
|
171
|
|
172 aim_chat_readroominfo(bs, &roominfo);
|
|
173
|
13592
|
174 detaillevel = byte_stream_get8(bs);
|
13234
|
175
|
|
176 if (detaillevel != 0x02) {
|
|
177 gaim_debug_misc("oscar", "faim: chat_roomupdateinfo: detail level %d not supported\n", detaillevel);
|
|
178 return 1;
|
|
179 }
|
|
180
|
13592
|
181 tlvcount = byte_stream_get16(bs);
|
13234
|
182
|
|
183 /*
|
|
184 * Everything else are TLVs.
|
|
185 */
|
|
186 tlvlist = aim_tlvlist_read(bs);
|
|
187
|
|
188 /*
|
|
189 * TLV type 0x006a is the room name in Human Readable Form.
|
|
190 */
|
13652
|
191 roomname = aim_tlv_getstr(tlvlist, 0x006a, 1);
|
13234
|
192
|
|
193 /*
|
|
194 * Type 0x006f: Number of occupants.
|
|
195 */
|
13652
|
196 usercount = aim_tlv_get16(tlvlist, 0x006f, 1);
|
13234
|
197
|
|
198 /*
|
|
199 * Type 0x0073: Occupant list.
|
|
200 */
|
13652
|
201 tlv = aim_tlv_gettlv(tlvlist, 0x0073, 1);
|
|
202 if (tlv != NULL)
|
|
203 {
|
13234
|
204 int curoccupant = 0;
|
13239
|
205 ByteStream occbs;
|
13234
|
206
|
|
207 /* Allocate enough userinfo structs for all occupants */
|
|
208 userinfo = calloc(usercount, sizeof(aim_userinfo_t));
|
|
209
|
13652
|
210 byte_stream_init(&occbs, tlv->value, tlv->length);
|
13234
|
211
|
|
212 while (curoccupant < usercount)
|
13592
|
213 aim_info_extract(od, &occbs, &userinfo[curoccupant++]);
|
13234
|
214 }
|
|
215
|
|
216 /*
|
|
217 * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG)
|
|
218 */
|
13652
|
219 flags = aim_tlv_get16(tlvlist, 0x00c9, 1);
|
13234
|
220
|
|
221 /*
|
|
222 * Type 0x00ca: Creation time (4 bytes)
|
|
223 */
|
13652
|
224 creationtime = aim_tlv_get32(tlvlist, 0x00ca, 1);
|
13234
|
225
|
|
226 /*
|
|
227 * Type 0x00d1: Maximum Message Length
|
|
228 */
|
13652
|
229 maxmsglen = aim_tlv_get16(tlvlist, 0x00d1, 1);
|
13234
|
230
|
|
231 /*
|
|
232 * Type 0x00d2: Unknown. (2 bytes)
|
|
233 */
|
13652
|
234 unknown_d2 = aim_tlv_get16(tlvlist, 0x00d2, 1);
|
13234
|
235
|
|
236 /*
|
|
237 * Type 0x00d3: Room Description
|
|
238 */
|
13652
|
239 roomdesc = aim_tlv_getstr(tlvlist, 0x00d3, 1);
|
13234
|
240
|
|
241 #if 0
|
|
242 /*
|
|
243 * Type 0x000d4: Unknown (flag only)
|
|
244 */
|
|
245 if (aim_tlv_gettlv(tlvlist, 0x000d4, 1)) {
|
|
246 /* Unhandled */
|
|
247 }
|
|
248 #endif
|
|
249
|
|
250 /*
|
|
251 * Type 0x00d5: Unknown. (1 byte)
|
|
252 */
|
13652
|
253 unknown_d5 = aim_tlv_get8(tlvlist, 0x00d5, 1);
|
13234
|
254
|
|
255 #if 0
|
|
256 /*
|
|
257 * Type 0x00d6: Encoding 1 ("us-ascii")
|
|
258 */
|
|
259 if (aim_tlv_gettlv(tlvlist, 0x000d6, 1)) {
|
|
260 /* Unhandled */
|
|
261 }
|
|
262
|
|
263 /*
|
|
264 * Type 0x00d7: Language 1 ("en")
|
|
265 */
|
|
266 if (aim_tlv_gettlv(tlvlist, 0x000d7, 1)) {
|
|
267 /* Unhandled */
|
|
268 }
|
|
269
|
|
270 /*
|
|
271 * Type 0x00d8: Encoding 2 ("us-ascii")
|
|
272 */
|
|
273 if (aim_tlv_gettlv(tlvlist, 0x000d8, 1)) {
|
|
274 /* Unhandled */
|
|
275 }
|
|
276
|
|
277 /*
|
|
278 * Type 0x00d9: Language 2 ("en")
|
|
279 */
|
|
280 if (aim_tlv_gettlv(tlvlist, 0x000d9, 1)) {
|
|
281 /* Unhandled */
|
|
282 }
|
|
283 #endif
|
|
284
|
|
285 /*
|
|
286 * Type 0x00da: Maximum visible message length
|
|
287 */
|
13652
|
288 maxvisiblemsglen = aim_tlv_get16(tlvlist, 0x00da, 1);
|
13234
|
289
|
13592
|
290 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) {
|
|
291 ret = userfunc(od, conn,
|
|
292 frame,
|
13234
|
293 &roominfo,
|
|
294 roomname,
|
|
295 usercount,
|
|
296 userinfo,
|
|
297 roomdesc,
|
|
298 flags,
|
|
299 creationtime,
|
|
300 maxmsglen,
|
|
301 unknown_d2,
|
|
302 unknown_d5,
|
|
303 maxvisiblemsglen);
|
|
304 }
|
|
305
|
|
306 free(roominfo.name);
|
|
307
|
|
308 while (usercount > 0)
|
|
309 aim_info_free(&userinfo[--usercount]);
|
|
310
|
|
311 free(userinfo);
|
|
312 free(roomname);
|
|
313 free(roomdesc);
|
|
314 aim_tlvlist_free(&tlvlist);
|
|
315
|
|
316 return ret;
|
|
317 }
|
|
318
|
|
319 /* Subtypes 0x0003 and 0x0004 */
|
13592
|
320 static int
|
|
321 userlistchange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
|
13234
|
322 {
|
|
323 aim_userinfo_t *userinfo = NULL;
|
|
324 aim_rxcallback_t userfunc;
|
|
325 int curcount = 0, ret = 0;
|
|
326
|
13592
|
327 while (byte_stream_empty(bs)) {
|
13234
|
328 curcount++;
|
|
329 userinfo = realloc(userinfo, curcount * sizeof(aim_userinfo_t));
|
13592
|
330 aim_info_extract(od, bs, &userinfo[curcount-1]);
|
13234
|
331 }
|
|
332
|
13592
|
333 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
|
|
334 ret = userfunc(od, conn, frame, curcount, userinfo);
|
13234
|
335
|
|
336 aim_info_free(userinfo);
|
|
337 free(userinfo);
|
|
338
|
|
339 return ret;
|
|
340 }
|
|
341
|
|
342 /*
|
|
343 * Subtype 0x0005 - Send a Chat Message.
|
|
344 *
|
|
345 * Possible flags:
|
|
346 * AIM_CHATFLAGS_NOREFLECT -- Unset the flag that requests messages
|
|
347 * should be sent to their sender.
|
|
348 * AIM_CHATFLAGS_AWAY -- Mark the message as an autoresponse
|
|
349 * (Note that WinAIM does not honor this,
|
|
350 * and displays the message as normal.)
|
|
351 *
|
|
352 * XXX convert this to use tlvchains
|
|
353 */
|
13592
|
354 int
|
|
355 aim_chat_send_im(OscarData *od, FlapConnection *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language)
|
13234
|
356 {
|
|
357 int i;
|
13592
|
358 FlapFrame *frame;
|
13239
|
359 IcbmCookie *cookie;
|
13234
|
360 aim_snacid_t snacid;
|
|
361 guint8 ckstr[8];
|
13652
|
362 aim_tlvlist_t *tlvlist = NULL, *inner_tlvlist = NULL;
|
13234
|
363
|
13592
|
364 if (!od || !conn || !msg || (msglen <= 0))
|
13234
|
365 return 0;
|
|
366
|
13592
|
367 frame = flap_frame_new(od, 0x02, 1152);
|
13234
|
368
|
13592
|
369 snacid = aim_cachesnac(od, 0x000e, 0x0005, 0x0000, NULL, 0);
|
|
370 aim_putsnac(&frame->data, 0x000e, 0x0005, 0x0000, snacid);
|
13234
|
371
|
|
372 /*
|
|
373 * Cookie
|
|
374 *
|
|
375 * XXX mkcookie should generate the cookie and cache it in one
|
|
376 * operation to preserve uniqueness.
|
|
377 */
|
|
378 for (i = 0; i < 8; i++)
|
|
379 ckstr[i] = (guint8)rand();
|
|
380
|
|
381 cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_CHAT, NULL);
|
|
382 cookie->data = NULL; /* XXX store something useful here */
|
|
383
|
13592
|
384 aim_cachecookie(od, cookie);
|
13234
|
385
|
|
386 /* ICBM Header */
|
13592
|
387 byte_stream_putraw(&frame->data, ckstr, 8); /* Cookie */
|
|
388 byte_stream_put16(&frame->data, 0x0003); /* Channel */
|
13234
|
389
|
|
390 /*
|
|
391 * Type 1: Flag meaning this message is destined to the room.
|
|
392 */
|
13652
|
393 aim_tlvlist_add_noval(&tlvlist, 0x0001);
|
13234
|
394
|
|
395 /*
|
|
396 * Type 6: Reflect
|
|
397 */
|
|
398 if (!(flags & AIM_CHATFLAGS_NOREFLECT))
|
13652
|
399 aim_tlvlist_add_noval(&tlvlist, 0x0006);
|
13234
|
400
|
|
401 /*
|
|
402 * Type 7: Autoresponse
|
|
403 */
|
|
404 if (flags & AIM_CHATFLAGS_AWAY)
|
13652
|
405 aim_tlvlist_add_noval(&tlvlist, 0x0007);
|
13234
|
406
|
|
407 /*
|
|
408 * SubTLV: Type 1: Message
|
|
409 */
|
13652
|
410 aim_tlvlist_add_raw(&inner_tlvlist, 0x0001, msglen, (guchar *)msg);
|
13234
|
411
|
|
412 /*
|
|
413 * SubTLV: Type 2: Encoding
|
|
414 */
|
|
415 if (encoding != NULL)
|
13652
|
416 aim_tlvlist_add_str(&inner_tlvlist, 0x0002, encoding);
|
13234
|
417
|
|
418 /*
|
|
419 * SubTLV: Type 3: Language
|
|
420 */
|
|
421 if (language != NULL)
|
13652
|
422 aim_tlvlist_add_str(&inner_tlvlist, 0x0003, language);
|
13234
|
423
|
|
424 /*
|
|
425 * Type 5: Message block. Contains more TLVs.
|
|
426 *
|
|
427 * This could include other information... We just
|
|
428 * put in a message TLV however.
|
|
429 *
|
|
430 */
|
13652
|
431 aim_tlvlist_add_frozentlvlist(&tlvlist, 0x0005, &inner_tlvlist);
|
13234
|
432
|
13652
|
433 aim_tlvlist_write(&frame->data, &tlvlist);
|
13234
|
434
|
13652
|
435 aim_tlvlist_free(&inner_tlvlist);
|
|
436 aim_tlvlist_free(&tlvlist);
|
13234
|
437
|
13592
|
438 flap_connection_send(conn, frame);
|
13234
|
439
|
|
440 return 0;
|
|
441 }
|
|
442
|
|
443 /*
|
|
444 * Subtype 0x0006
|
|
445 *
|
|
446 * We could probably include this in the normal ICBM parsing
|
|
447 * code as channel 0x0003, however, since only the start
|
|
448 * would be the same, we might as well do it here.
|
|
449 *
|
|
450 * General outline of this SNAC:
|
|
451 * snac
|
|
452 * cookie
|
|
453 * channel id
|
|
454 * tlvlist
|
|
455 * unknown
|
|
456 * source user info
|
|
457 * name
|
|
458 * evility
|
|
459 * userinfo tlvs
|
|
460 * online time
|
|
461 * etc
|
|
462 * message metatlv
|
|
463 * message tlv
|
|
464 * message string
|
|
465 * possibly others
|
|
466 *
|
|
467 */
|
13592
|
468 static int
|
|
469 incomingim_ch3(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
|
13234
|
470 {
|
|
471 int ret = 0, i;
|
|
472 aim_rxcallback_t userfunc;
|
|
473 aim_userinfo_t userinfo;
|
|
474 guint8 cookie[8];
|
|
475 guint16 channel;
|
13652
|
476 aim_tlvlist_t *tlvlist;
|
13234
|
477 char *msg = NULL;
|
|
478 int len = 0;
|
|
479 char *encoding = NULL, *language = NULL;
|
13239
|
480 IcbmCookie *ck;
|
13652
|
481 aim_tlv_t *tlv;
|
|
482 ByteStream tbs;
|
13234
|
483
|
|
484 memset(&userinfo, 0, sizeof(aim_userinfo_t));
|
|
485
|
|
486 /*
|
|
487 * Read ICBM Cookie.
|
|
488 */
|
|
489 for (i = 0; i < 8; i++)
|
13592
|
490 cookie[i] = byte_stream_get8(bs);
|
13234
|
491
|
13592
|
492 if ((ck = aim_uncachecookie(od, cookie, AIM_COOKIETYPE_CHAT))) {
|
13234
|
493 free(ck->data);
|
|
494 free(ck);
|
|
495 }
|
|
496
|
|
497 /*
|
|
498 * Channel ID
|
|
499 *
|
|
500 * Channel 0x0003 is used for chat messages.
|
|
501 *
|
|
502 */
|
13592
|
503 channel = byte_stream_get16(bs);
|
13234
|
504
|
|
505 if (channel != 0x0003) {
|
|
506 gaim_debug_misc("oscar", "faim: chat_incoming: unknown channel! (0x%04x)\n", channel);
|
|
507 return 0;
|
|
508 }
|
|
509
|
|
510 /*
|
|
511 * Start parsing TLVs right away.
|
|
512 */
|
13652
|
513 tlvlist = aim_tlvlist_read(bs);
|
13234
|
514
|
|
515 /*
|
|
516 * Type 0x0003: Source User Information
|
|
517 */
|
13652
|
518 tlv = aim_tlv_gettlv(tlvlist, 0x0003, 1);
|
|
519 if (tlv != NULL)
|
|
520 {
|
|
521 byte_stream_init(&tbs, tlv->value, tlv->length);
|
13592
|
522 aim_info_extract(od, &tbs, &userinfo);
|
13234
|
523 }
|
|
524
|
|
525 #if 0
|
|
526 /*
|
|
527 * Type 0x0001: If present, it means it was a message to the
|
|
528 * room (as opposed to a whisper).
|
|
529 */
|
13652
|
530 if (aim_tlv_gettlv(tlvlist, 0x0001, 1)) {
|
13234
|
531 /* Unhandled */
|
|
532 }
|
|
533 #endif
|
|
534
|
|
535 /*
|
|
536 * Type 0x0005: Message Block. Conains more TLVs.
|
|
537 */
|
13652
|
538 tlv = aim_tlv_gettlv(tlvlist, 0x0005, 1);
|
|
539 if (tlv != NULL)
|
|
540 {
|
|
541 aim_tlvlist_t *inner_tlvlist;
|
|
542 aim_tlv_t *inner_tlv;
|
13234
|
543
|
13652
|
544 byte_stream_init(&tbs, tlv->value, tlv->length);
|
|
545 inner_tlvlist = aim_tlvlist_read(&tbs);
|
13234
|
546
|
|
547 /*
|
|
548 * Type 0x0001: Message.
|
|
549 */
|
13652
|
550 inner_tlv = aim_tlv_gettlv(inner_tlvlist, 0x0001, 1);
|
|
551 if (inner_tlv != NULL)
|
|
552 {
|
|
553 len = inner_tlv->length;
|
|
554 msg = aim_tlv_getvalue_as_string(inner_tlv);
|
13234
|
555 }
|
|
556
|
|
557 /*
|
|
558 * Type 0x0002: Encoding.
|
|
559 */
|
13652
|
560 encoding = aim_tlv_getstr(inner_tlvlist, 0x0002, 1);
|
13234
|
561
|
|
562 /*
|
|
563 * Type 0x0003: Language.
|
|
564 */
|
13652
|
565 language = aim_tlv_getstr(inner_tlvlist, 0x0003, 1);
|
13234
|
566
|
13652
|
567 aim_tlvlist_free(&inner_tlvlist);
|
13234
|
568 }
|
|
569
|
13592
|
570 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
|
|
571 ret = userfunc(od, conn, frame, &userinfo, len, msg, encoding, language);
|
13234
|
572
|
|
573 aim_info_free(&userinfo);
|
|
574 free(msg);
|
13652
|
575 free(encoding);
|
|
576 free(language);
|
|
577 aim_tlvlist_free(&tlvlist);
|
13234
|
578
|
|
579 return ret;
|
|
580 }
|
|
581
|
13592
|
582 static int
|
|
583 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
|
13234
|
584 {
|
|
585 if (snac->subtype == 0x0002)
|
13592
|
586 return infoupdate(od, conn, mod, frame, snac, bs);
|
13234
|
587 else if ((snac->subtype == 0x0003) || (snac->subtype == 0x0004))
|
13592
|
588 return userlistchange(od, conn, mod, frame, snac, bs);
|
13234
|
589 else if (snac->subtype == 0x0006)
|
13592
|
590 return incomingim_ch3(od, conn, mod, frame, snac, bs);
|
13234
|
591
|
|
592 return 0;
|
|
593 }
|
|
594
|
13592
|
595 int
|
|
596 chat_modfirst(OscarData *od, aim_module_t *mod)
|
13234
|
597 {
|
|
598 mod->family = 0x000e;
|
|
599 mod->version = 0x0001;
|
|
600 mod->toolid = 0x0010;
|
|
601 mod->toolversion = 0x0629;
|
|
602 mod->flags = 0;
|
|
603 strncpy(mod->name, "chat", sizeof(mod->name));
|
|
604 mod->snachandler = snachandler;
|
|
605
|
|
606 return 0;
|
|
607 }
|