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