annotate src/protocols/oscar/chat.c @ 11687:941aa045f9f6

[gaim-migrate @ 13973] sadrul fixed sounds for focused conversations, or something. All I know is, I have my sounds back, so major points for him. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 17 Oct 2005 21:12:56 +0000
parents 7d31d61e6438
children 59207955adc2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
2 * Family 0x000e - Routines for the Chat service.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 *
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 */
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 #define FAIM_INTERNAL
10271
361c9170d8af [gaim-migrate @ 11420]
Mark Doliner <mark@kingant.net>
parents: 10267
diff changeset
7 #include <aim.h>
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
5927
04dc7fe68889 [gaim-migrate @ 6367]
Mark Doliner <mark@kingant.net>
parents: 5836
diff changeset
9 #include <string.h>
04dc7fe68889 [gaim-migrate @ 6367]
Mark Doliner <mark@kingant.net>
parents: 5836
diff changeset
10
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
11 /* Stored in the ->internal of chat connections */
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
12 struct chatconnpriv {
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
13 fu16_t exchange;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
14 char *name;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
15 fu16_t instance;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
16 };
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
17
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
18 faim_internal void aim_conn_kill_chat(aim_session_t *sess, aim_conn_t *conn)
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
19 {
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
20 struct chatconnpriv *ccp = (struct chatconnpriv *)conn->internal;
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
21
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
22 if (ccp)
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
23 free(ccp->name);
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
24 free(ccp);
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
25
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
26 return;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
27 }
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
28
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
29 faim_export char *aim_chat_getname(aim_conn_t *conn)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 {
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
31 struct chatconnpriv *ccp;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
32
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
33 if (!conn)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
34 return NULL;
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
35
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
36 if (conn->type != AIM_CONN_TYPE_CHAT)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
37 return NULL;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
39 ccp = (struct chatconnpriv *)conn->internal;
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
40
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
41 return ccp->name;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
2270
d82efea341ef [gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2246
diff changeset
44 /* XXX get this into conn.c -- evil!! */
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
45 faim_export aim_conn_t *aim_chat_getconn(aim_session_t *sess, const char *name)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
47 aim_conn_t *cur;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
49 for (cur = sess->connlist; cur; cur = cur->next) {
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
50 struct chatconnpriv *ccp = (struct chatconnpriv *)cur->internal;
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
51
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
52 if (cur->type != AIM_CONN_TYPE_CHAT)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
53 continue;
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
54 if (!cur->internal) {
11253
7d31d61e6438 [gaim-migrate @ 13422]
Mark Doliner <mark@kingant.net>
parents: 11159
diff changeset
55 gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", cur->fd);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
56 continue;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
57 }
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
58
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
59 if (strcmp(ccp->name, name) == 0)
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
60 break;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
61 }
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
62
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
63 return cur;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
66 faim_export int aim_chat_attachname(aim_conn_t *conn, fu16_t exchange, const char *roomname, fu16_t instance)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 {
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
68 struct chatconnpriv *ccp;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
69
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
70 if (!conn || !roomname)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
71 return -EINVAL;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
73 if (conn->internal)
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
74 free(conn->internal);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
76 if (!(ccp = malloc(sizeof(struct chatconnpriv))))
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
77 return -ENOMEM;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
78
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
79 ccp->exchange = exchange;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
80 ccp->name = strdup(roomname);
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
81 ccp->instance = instance;
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
82
11074
ba630d7a7365 [gaim-migrate @ 13083]
Mark Doliner <mark@kingant.net>
parents: 10994
diff changeset
83 conn->internal = (void *)ccp;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
85 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
88 faim_internal int aim_chat_readroominfo(aim_bstream_t *bs, struct aim_chat_roominfo *outinfo)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
90 int namelen;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
92 if (!bs || !outinfo)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
93 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
95 outinfo->exchange = aimbs_get16(bs);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
96 namelen = aimbs_get8(bs);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
97 outinfo->name = aimbs_getstr(bs, namelen);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
98 outinfo->instance = aimbs_get16(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
100 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
103 faim_export int aim_chat_leaveroom(aim_session_t *sess, const char *name)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
105 aim_conn_t *conn;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
107 if (!(conn = aim_chat_getconn(sess, name)))
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
108 return -ENOENT;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
10271
361c9170d8af [gaim-migrate @ 11420]
Mark Doliner <mark@kingant.net>
parents: 10267
diff changeset
110 aim_conn_close(conn);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
111
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
112 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 /*
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
116 * Subtype 0x0002 - General room information. Lots of stuff.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 *
8735
92cbf9713795 [gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents: 8283
diff changeset
118 * Values I know are in here but I haven't attached
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 * them to any of the 'Unknown's:
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 * - Language (English)
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 *
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 */
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
123 static int infoupdate(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 {
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
125 aim_userinfo_t *userinfo = NULL;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
126 aim_rxcallback_t userfunc;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
127 int ret = 0;
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
128 int usercount = 0;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
129 fu8_t detaillevel = 0;
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
130 char *roomname = NULL;
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
131 struct aim_chat_roominfo roominfo;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
132 fu16_t tlvcount = 0;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
133 aim_tlvlist_t *tlvlist;
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
134 char *roomdesc = NULL;
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
135 fu16_t flags = 0;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
136 fu32_t creationtime = 0;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
137 fu16_t maxmsglen = 0, maxvisiblemsglen = 0;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
138 fu16_t unknown_d2 = 0, unknown_d5 = 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
140 aim_chat_readroominfo(bs, &roominfo);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
141
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
142 detaillevel = aimbs_get8(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
144 if (detaillevel != 0x02) {
11253
7d31d61e6438 [gaim-migrate @ 13422]
Mark Doliner <mark@kingant.net>
parents: 11159
diff changeset
145 gaim_debug_misc("oscar", "faim: chat_roomupdateinfo: detail level %d not supported\n", detaillevel);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
146 return 1;
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
147 }
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
148
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
149 tlvcount = aimbs_get16(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
151 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
152 * Everything else are TLVs.
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
153 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
154 tlvlist = aim_tlvlist_read(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
156 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
157 * TLV type 0x006a is the room name in Human Readable Form.
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
158 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
159 if (aim_tlv_gettlv(tlvlist, 0x006a, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
160 roomname = aim_tlv_getstr(tlvlist, 0x006a, 1);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
161
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
162 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
163 * Type 0x006f: Number of occupants.
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
164 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
165 if (aim_tlv_gettlv(tlvlist, 0x006f, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
166 usercount = aim_tlv_get16(tlvlist, 0x006f, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
168 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
169 * Type 0x0073: Occupant list.
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
170 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
171 if (aim_tlv_gettlv(tlvlist, 0x0073, 1)) {
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
172 int curoccupant = 0;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
173 aim_tlv_t *tmptlv;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
174 aim_bstream_t occbs;
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
175
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
176 tmptlv = aim_tlv_gettlv(tlvlist, 0x0073, 1);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
177
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
178 /* Allocate enough userinfo structs for all occupants */
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
179 userinfo = calloc(usercount, sizeof(aim_userinfo_t));
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
180
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
181 aim_bstream_init(&occbs, tmptlv->value, tmptlv->length);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
182
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
183 while (curoccupant < usercount)
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
184 aim_info_extract(sess, &occbs, &userinfo[curoccupant++]);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
185 }
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
186
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
187 /*
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
188 * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG)
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
189 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
190 if (aim_tlv_gettlv(tlvlist, 0x00c9, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
191 flags = aim_tlv_get16(tlvlist, 0x00c9, 1);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
192
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
193 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
194 * Type 0x00ca: Creation time (4 bytes)
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
195 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
196 if (aim_tlv_gettlv(tlvlist, 0x00ca, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
197 creationtime = aim_tlv_get32(tlvlist, 0x00ca, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
199 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
200 * Type 0x00d1: Maximum Message Length
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
201 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
202 if (aim_tlv_gettlv(tlvlist, 0x00d1, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
203 maxmsglen = aim_tlv_get16(tlvlist, 0x00d1, 1);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
204
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
205 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
206 * Type 0x00d2: Unknown. (2 bytes)
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
207 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
208 if (aim_tlv_gettlv(tlvlist, 0x00d2, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
209 unknown_d2 = aim_tlv_get16(tlvlist, 0x00d2, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
211 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
212 * Type 0x00d3: Room Description
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
213 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
214 if (aim_tlv_gettlv(tlvlist, 0x00d3, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
215 roomdesc = aim_tlv_getstr(tlvlist, 0x00d3, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
217 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
218 * Type 0x000d4: Unknown (flag only)
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
219 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
220 if (aim_tlv_gettlv(tlvlist, 0x000d4, 1))
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
221 ;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
223 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
224 * Type 0x00d5: Unknown. (1 byte)
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
225 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
226 if (aim_tlv_gettlv(tlvlist, 0x00d5, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
227 unknown_d5 = aim_tlv_get8(tlvlist, 0x00d5, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
230 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
231 * Type 0x00d6: Encoding 1 ("us-ascii")
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
232 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
233 if (aim_tlv_gettlv(tlvlist, 0x000d6, 1))
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
234 ;
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
235
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
236 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
237 * Type 0x00d7: Language 1 ("en")
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
238 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
239 if (aim_tlv_gettlv(tlvlist, 0x000d7, 1))
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
240 ;
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
241
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
242 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
243 * Type 0x00d8: Encoding 2 ("us-ascii")
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
244 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
245 if (aim_tlv_gettlv(tlvlist, 0x000d8, 1))
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
246 ;
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
247
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
248 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
249 * Type 0x00d9: Language 2 ("en")
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
250 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
251 if (aim_tlv_gettlv(tlvlist, 0x000d9, 1))
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
252 ;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
253
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
254 /*
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
255 * Type 0x00da: Maximum visible message length
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
256 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
257 if (aim_tlv_gettlv(tlvlist, 0x000da, 1))
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
258 maxvisiblemsglen = aim_tlv_get16(tlvlist, 0x00da, 1);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
259
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
260 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) {
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
261 ret = userfunc(sess,
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
262 rx,
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
263 &roominfo,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
264 roomname,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
265 usercount,
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
266 userinfo,
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
267 roomdesc,
2821
9467e4ee81be [gaim-migrate @ 2834]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2672
diff changeset
268 flags,
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
269 creationtime,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
270 maxmsglen,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
271 unknown_d2,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
272 unknown_d5,
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
273 maxvisiblemsglen);
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
274 }
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
275
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
276 free(roominfo.name);
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
277
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
278 while (usercount > 0)
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
279 aim_info_free(&userinfo[--usercount]);
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
280
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
281 free(userinfo);
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
282 free(roomname);
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
283 free(roomdesc);
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
284 aim_tlvlist_free(&tlvlist);
2167
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
285
edf8c5a70e5b [gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2086
diff changeset
286 return ret;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
287 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
288
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
289 /* Subtypes 0x0003 and 0x0004 */
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
290 static int userlistchange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 {
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
292 aim_userinfo_t *userinfo = NULL;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
293 aim_rxcallback_t userfunc;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
294 int curcount = 0, ret = 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
296 while (aim_bstream_empty(bs)) {
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
297 curcount++;
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
298 userinfo = realloc(userinfo, curcount * sizeof(aim_userinfo_t));
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
299 aim_info_extract(sess, bs, &userinfo[curcount-1]);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
300 }
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
301
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
302 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
303 ret = userfunc(sess, rx, curcount, userinfo);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
304
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
305 aim_info_free(userinfo);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
306 free(userinfo);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
307
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
308 return ret;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
309 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311 /*
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
312 * Subtype 0x0005 - Send a Chat Message.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
313 *
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
314 * Possible flags:
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
315 * AIM_CHATFLAGS_NOREFLECT -- Unset the flag that requests messages
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
316 * should be sent to their sender.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
317 * AIM_CHATFLAGS_AWAY -- Mark the message as an autoresponse
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
318 * (Note that WinAIM does not honor this,
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
319 * and displays the message as normal.)
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
320 *
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
321 * XXX convert this to use tlvchains
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
322 */
11159
bd8ac1d4b2f2 [gaim-migrate @ 13246]
Mark Doliner <mark@kingant.net>
parents: 11074
diff changeset
323 faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const gchar *msg, int msglen, const char *encoding, const char *language)
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
324 {
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
325 int i;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
326 aim_frame_t *fr;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
327 aim_msgcookie_t *cookie;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
328 aim_snacid_t snacid;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
329 fu8_t ckstr[8];
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
330 aim_tlvlist_t *otl = NULL, *itl = NULL;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
331
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
332 if (!sess || !conn || !msg || (msglen <= 0))
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
333 return 0;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
334
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
335 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152)))
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
336 return -ENOMEM;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
337
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
338 snacid = aim_cachesnac(sess, 0x000e, 0x0005, 0x0000, NULL, 0);
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
339 aim_putsnac(&fr->data, 0x000e, 0x0005, 0x0000, snacid);
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
340
4901
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
341 /*
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
342 * Cookie
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
343 *
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
344 * XXX mkcookie should generate the cookie and cache it in one
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
345 * operation to preserve uniqueness.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
346 */
4901
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
347 for (i = 0; i < 8; i++)
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
348 ckstr[i] = (fu8_t)rand();
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
349
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
350 cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_CHAT, NULL);
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
351 cookie->data = NULL; /* XXX store something useful here */
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
352
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
353 aim_cachecookie(sess, cookie);
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
354
4901
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
355 /* ICBM Header */
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
356 aimbs_putraw(&fr->data, ckstr, 8); /* Cookie */
ad589b887af9 [gaim-migrate @ 5235]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
357 aimbs_put16(&fr->data, 0x0003); /* Channel */
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
358
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
359 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
360 * Type 1: Flag meaning this message is destined to the room.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
361 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
362 aim_tlvlist_add_noval(&otl, 0x0001);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
363
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
364 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
365 * Type 6: Reflect
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
366 */
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
367 if (!(flags & AIM_CHATFLAGS_NOREFLECT))
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
368 aim_tlvlist_add_noval(&otl, 0x0006);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
369
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
370 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
371 * Type 7: Autoresponse
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
372 */
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
373 if (flags & AIM_CHATFLAGS_AWAY)
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
374 aim_tlvlist_add_noval(&otl, 0x0007);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
375
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
376 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
377 * SubTLV: Type 1: Message
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
378 */
11159
bd8ac1d4b2f2 [gaim-migrate @ 13246]
Mark Doliner <mark@kingant.net>
parents: 11074
diff changeset
379 aim_tlvlist_add_raw(&itl, 0x0001, msglen, (guchar *)msg);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
380
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
381 /*
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
382 * SubTLV: Type 2: Encoding
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
383 */
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
384 if (encoding != NULL)
10991
1798ad0be460 [gaim-migrate @ 12829]
Mark Doliner <mark@kingant.net>
parents: 10986
diff changeset
385 aim_tlvlist_add_str(&itl, 0x0002, encoding);
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
386
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
387 /*
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
388 * SubTLV: Type 3: Language
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
389 */
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
390 if (language != NULL)
10991
1798ad0be460 [gaim-migrate @ 12829]
Mark Doliner <mark@kingant.net>
parents: 10986
diff changeset
391 aim_tlvlist_add_str(&itl, 0x0003, language);
8219
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
392
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
393 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
394 * Type 5: Message block. Contains more TLVs.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
395 *
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
396 * This could include other information... We just
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
397 * put in a message TLV however.
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
398 *
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
399 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
400 aim_tlvlist_add_frozentlvlist(&otl, 0x0005, &itl);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
401
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
402 aim_tlvlist_write(&fr->data, &otl);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
403
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
404 aim_tlvlist_free(&itl);
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
405 aim_tlvlist_free(&otl);
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
406
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
407 aim_tx_enqueue(sess, fr);
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
408
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
409 return 0;
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
410 }
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
411
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
412 /*
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
413 * Subtype 0x0006
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2821
diff changeset
414 *
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
415 * We could probably include this in the normal ICBM parsing
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
416 * code as channel 0x0003, however, since only the start
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
417 * would be the same, we might as well do it here.
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418 *
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
419 * General outline of this SNAC:
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
420 * snac
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
421 * cookie
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
422 * channel id
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
423 * tlvlist
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
424 * unknown
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
425 * source user info
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
426 * name
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
427 * evility
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
428 * userinfo tlvs
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
429 * online time
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
430 * etc
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
431 * message metatlv
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
432 * message tlv
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
433 * message string
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
434 * possibly others
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
435 *
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
436 */
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
437 static int incomingim_ch3(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
438 {
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
439 int ret = 0, i;
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
440 aim_rxcallback_t userfunc;
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
441 aim_userinfo_t userinfo;
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
442 fu8_t cookie[8];
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
443 fu16_t channel;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
444 aim_tlvlist_t *otl;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
445 char *msg = NULL;
8283
35f69749b226 [gaim-migrate @ 9007]
Luke Schierer <lschiere@pidgin.im>
parents: 8233
diff changeset
446 int len = 0;
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
447 char *encoding = NULL, *language = NULL;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
448 aim_msgcookie_t *ck;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
449
2421
95b4ec08abec [gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2270
diff changeset
450 memset(&userinfo, 0, sizeof(aim_userinfo_t));
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
451
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
452 /*
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
453 * Read ICBM Cookie.
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
454 */
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
455 for (i = 0; i < 8; i++)
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
456 cookie[i] = aimbs_get8(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
457
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
458 if ((ck = aim_uncachecookie(sess, cookie, AIM_COOKIETYPE_CHAT))) {
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
459 free(ck->data);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
460 free(ck);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
461 }
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
462
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
463 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
464 * Channel ID
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
465 *
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
466 * Channel 0x0003 is used for chat messages.
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
467 *
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
468 */
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
469 channel = aimbs_get16(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
470
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
471 if (channel != 0x0003) {
11253
7d31d61e6438 [gaim-migrate @ 13422]
Mark Doliner <mark@kingant.net>
parents: 11159
diff changeset
472 gaim_debug_misc("oscar", "faim: chat_incoming: unknown channel! (0x%04x)\n", channel);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
473 return 0;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
474 }
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
475
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
476 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
477 * Start parsing TLVs right away.
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
478 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
479 otl = aim_tlvlist_read(bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
480
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
481 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
482 * Type 0x0003: Source User Information
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
483 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
484 if (aim_tlv_gettlv(otl, 0x0003, 1)) {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
485 aim_tlv_t *userinfotlv;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
486 aim_bstream_t tbs;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
487
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
488 userinfotlv = aim_tlv_gettlv(otl, 0x0003, 1);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
489
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
490 aim_bstream_init(&tbs, userinfotlv->value, userinfotlv->length);
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
491 aim_info_extract(sess, &tbs, &userinfo);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
492 }
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
493
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
494 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
495 * Type 0x0001: If present, it means it was a message to the
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
496 * room (as opposed to a whisper).
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
497 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
498 if (aim_tlv_gettlv(otl, 0x0001, 1))
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
499 ;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
500
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
501 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
502 * Type 0x0005: Message Block. Conains more TLVs.
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
503 */
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
504 if (aim_tlv_gettlv(otl, 0x0005, 1)) {
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
505 aim_tlvlist_t *itl;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
506 aim_tlv_t *msgblock;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
507 aim_bstream_t tbs;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
508
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
509 msgblock = aim_tlv_gettlv(otl, 0x0005, 1);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
510 aim_bstream_init(&tbs, msgblock->value, msgblock->length);
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
511 itl = aim_tlvlist_read(&tbs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
512
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
513 /*
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
514 * Type 0x0001: Message.
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
515 */
8219
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
516 if (aim_tlv_gettlv(itl, 0x0001, 1)) {
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
517 msg = aim_tlv_getstr(itl, 0x0001, 1);
8219
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
518 len = aim_tlv_gettlv(itl, 0x0001, 1)->length;
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
519 }
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
520
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
521 /*
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
522 * Type 0x0002: Encoding.
8219
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
523 */
862dc2839646 [gaim-migrate @ 8942]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
524 if (aim_tlv_gettlv(itl, 0x0002, 1))
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
525 encoding = aim_tlv_getstr(itl, 0x0002, 1);
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
526
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
527 /*
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
528 * Type 0x0003: Language.
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
529 */
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
530 if (aim_tlv_gettlv(itl, 0x0003, 1))
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
531 language = aim_tlv_getstr(itl, 0x0003, 1);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
532
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
533 aim_tlvlist_free(&itl);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
534 }
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
535
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
536 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
8233
4f70e8b3e05e [gaim-migrate @ 8956]
Mark Doliner <mark@kingant.net>
parents: 8225
diff changeset
537 ret = userfunc(sess, rx, &userinfo, len, msg, encoding, language);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
538
5836
09f7f23dc83a [gaim-migrate @ 6267]
Mark Doliner <mark@kingant.net>
parents: 4901
diff changeset
539 aim_info_free(&userinfo);
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
540 free(msg);
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 6001
diff changeset
541 aim_tlvlist_free(&otl);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
542
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
543 return ret;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
544 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
545
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
546 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
547 {
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
548
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
549 if (snac->subtype == 0x0002)
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
550 return infoupdate(sess, mod, rx, snac, bs);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
551 else if ((snac->subtype == 0x0003) || (snac->subtype == 0x0004))
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
552 return userlistchange(sess, mod, rx, snac, bs);
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
553 else if (snac->subtype == 0x0006)
8225
9790cda80d52 [gaim-migrate @ 8948]
Mark Doliner <mark@kingant.net>
parents: 8219
diff changeset
554 return incomingim_ch3(sess, mod, rx, snac, bs);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
555
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
556 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
557 }
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
558
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
559 faim_internal int chat_modfirst(aim_session_t *sess, aim_module_t *mod)
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
560 {
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
561
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
562 mod->family = 0x000e;
2672
c41030cfed76 [gaim-migrate @ 2685]
Adam Fritzler <mid@auk.cx>
parents: 2421
diff changeset
563 mod->version = 0x0001;
4071
2532f1192da3 [gaim-migrate @ 4283]
Mark Doliner <mark@kingant.net>
parents: 3952
diff changeset
564 mod->toolid = 0x0010;
2532f1192da3 [gaim-migrate @ 4283]
Mark Doliner <mark@kingant.net>
parents: 3952
diff changeset
565 mod->toolversion = 0x0629;
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
566 mod->flags = 0;
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
567 strncpy(mod->name, "chat", sizeof(mod->name));
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
568 mod->snachandler = snachandler;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
569
2246
933346315b9b [gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2167
diff changeset
570 return 0;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
571 }