annotate libfaim/chatnav.c @ 1608:e19a2cb4190c

[gaim-migrate @ 1618] allow plugins access to the window committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 17 Mar 2001 04:41:38 +0000
parents 1e2cc8c8bf3c
children 3fe5799b7823
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 * Handle ChatNav.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 * [The ChatNav(igation) service does various things to keep chat
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 * alive. It provides room information, room searching and creating,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 * as well as giving users the right ("permission") to use chat.]
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 #define FAIM_INTERNAL
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 #include <aim.h>
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 * conn must be a chatnav connection!
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 faim_export unsigned long aim_chatnav_reqrights(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 struct aim_conn_t *conn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 aim_genericreq_n(sess, conn, 0x000d, 0x0002);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 faim_export unsigned long aim_chatnav_clientready(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 struct aim_conn_t *conn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 0x20)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 i = aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 i+= aimutil_put16(newpacket->data+i, 0x000d);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 i+= aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 i+= aimutil_put16(newpacket->data+i, 0x0004);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 i+= aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 i+= aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 i+= aimutil_put16(newpacket->data+i, 0x0003);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 i+= aimutil_put16(newpacket->data+i, 0x0004);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 i+= aimutil_put16(newpacket->data+i, 0x0686);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 return (sess->snac_nextid++);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 * Since multiple things can trigger this callback,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 * we must lookup the snacid to determine the original
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 * snac subtype that was called.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 faim_internal int aim_chatnav_parse_info(struct aim_session_t *sess, struct command_rx_struct *command)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 struct aim_snac_t *snac;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 u_long snacid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 rxcallback_t userfunc;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 int ret=1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 snacid = aimutil_get32(command->data+6);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 snac = aim_remsnac(sess, snacid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 if (!snac) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 faimdprintf(sess, 0, "faim: chatnav_parse_info: received response to unknown request! (%08lx)\n", snacid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 if (snac->family != 0x000d) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 faimdprintf(sess, 0, "faim: chatnav_parse_info: recieved response that maps to corrupt request! (fam=%04x)\n", snac->family);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 * We now know what the original SNAC subtype was.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 switch(snac->type)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 case 0x0002: /* request chat rights */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 struct aim_tlvlist_t *tlvlist;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 struct aim_chat_exchangeinfo *exchanges = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 int curexchange = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 struct aim_tlv_t *exchangetlv;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 u_char maxrooms = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 struct aim_tlvlist_t *innerlist;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 tlvlist = aim_readtlvchain(command->data+10, command->commandlen-10);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 * Type 0x0002: Maximum concurrent rooms.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 if (aim_gettlv(tlvlist, 0x0002, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 maxrooms = aim_gettlv8(tlvlist, 0x0002, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 * Type 0x0003: Exchange information
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 * There can be any number of these, each one
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 * representing another exchange.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 curexchange = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 while ((exchangetlv = aim_gettlv(tlvlist, 0x0003, curexchange+1)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 curexchange++;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 exchanges = realloc(exchanges, curexchange * sizeof(struct aim_chat_exchangeinfo));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 /* exchange number */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 exchanges[curexchange-1].number = aimutil_get16(exchangetlv->value);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 innerlist = aim_readtlvchain(exchangetlv->value+2, exchangetlv->length-2);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 * Type 0x000d: Unknown.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 if (aim_gettlv(innerlist, 0x000d, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 * Type 0x0004: Unknown
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 if (aim_gettlv(innerlist, 0x0004, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 * Type 0x0002: Unknown
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 if (aim_gettlv(innerlist, 0x0002, 1)) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 unsigned short classperms;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 classperms = aim_gettlv16(innerlist, 0x0002, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 faimdprintf(sess, 1, "faim: class permissions %x\n", classperms);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 * Type 0x00c9: Unknown
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 if (aim_gettlv(innerlist, 0x00c9, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 * Type 0x00ca: Creation Date
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 if (aim_gettlv(innerlist, 0x00ca, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 * Type 0x00d0: Mandatory Channels?
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 if (aim_gettlv(innerlist, 0x00d0, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 * Type 0x00d1: Maximum Message length
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 if (aim_gettlv(innerlist, 0x00d1, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 * Type 0x00d2: Maximum Occupancy?
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 if (aim_gettlv(innerlist, 0x00d2, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 ;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 * Type 0x00d3: Exchange Name
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 if (aim_gettlv(innerlist, 0x00d3, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 exchanges[curexchange-1].name = aim_gettlv_str(innerlist, 0x00d3, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 exchanges[curexchange-1].name = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 * Type 0x00d5: Creation Permissions
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 * 0 Creation not allowed
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 * 1 Room creation allowed
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 * 2 Exchange creation allowed
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
186 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
187 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
188 if (aim_gettlv(innerlist, 0x00d5, 1)) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189 unsigned char createperms;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 createperms = aim_gettlv8(innerlist, 0x00d5, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195 * Type 0x00d6: Character Set (First Time)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
197 if (aim_gettlv(innerlist, 0x00d6, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 exchanges[curexchange-1].charset1 = aim_gettlv_str(innerlist, 0x00d6, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
200 exchanges[curexchange-1].charset1 = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
201
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
202 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203 * Type 0x00d7: Language (First Time)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
204 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
205 if (aim_gettlv(innerlist, 0x00d7, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
206 exchanges[curexchange-1].lang1 = aim_gettlv_str(innerlist, 0x00d7, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
207 else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
208 exchanges[curexchange-1].lang1 = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 * Type 0x00d8: Character Set (Second Time)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213 if (aim_gettlv(innerlist, 0x00d8, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 exchanges[curexchange-1].charset2 = aim_gettlv_str(innerlist, 0x00d8, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215 else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216 exchanges[curexchange-1].charset2 = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
218 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219 * Type 0x00d9: Language (Second Time)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221 if (aim_gettlv(innerlist, 0x00d9, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222 exchanges[curexchange-1].lang2 = aim_gettlv_str(innerlist, 0x00d9, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
223 else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 exchanges[curexchange-1].lang2 = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
226 aim_freetlvchain(&innerlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
230 * Call client.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
231 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
232 if ((userfunc = aim_callhandler(sess, command->conn, 0x000d, 0x0009)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
233 ret = userfunc(sess, command, snac->type, maxrooms, curexchange, exchanges);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
234 curexchange--;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
235 while(curexchange >= 0)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
236 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
237 if (exchanges[curexchange].name)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
238 free(exchanges[curexchange].name);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
239 if (exchanges[curexchange].charset1)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
240 free(exchanges[curexchange].charset1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
241 if (exchanges[curexchange].lang1)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
242 free(exchanges[curexchange].lang1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
243 if (exchanges[curexchange].charset2)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
244 free(exchanges[curexchange].charset2);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
245 if (exchanges[curexchange].lang2)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
246 free(exchanges[curexchange].lang2);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
247 curexchange--;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
248 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
249 free(exchanges);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
250 aim_freetlvchain(&tlvlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
251
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
252 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
253 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
254 case 0x0003: /* request exchange info */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
255 faimdprintf(sess, 0, "chatnav_parse_info: resposne to exchange info\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
256 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
257 case 0x0004: /* request room info */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
258 faimdprintf(sess, 0, "chatnav_parse_info: response to room info\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
259 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
260 case 0x0005: /* request more room info */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
261 faimdprintf(sess, 0, "chatnav_parse_info: response to more room info\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
262 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
263 case 0x0006: /* request occupant list */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 faimdprintf(sess, 0, "chatnav_parse_info: response to occupant info\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
266 case 0x0007: /* search for a room */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
267 faimdprintf(sess, 0, "chatnav_parse_info: search results\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
268 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
269 case 0x0008: { /* create room */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
270 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
271 000d 0009 0000 0000 0010
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
272
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
273 0004 0053
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
274 0004 -- exchange
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
275 0c 7a 6f6f 6f6d 7a6f 6f6f 6d34 32 cookie/name
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
276 0000 -- instance
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
277 02 -- detail level
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
278 0007 -- unknown!
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
279 006a 000c 7a 6f 6f6f 6d7a 6f6f 6f6d 3432 -- fully qualified name
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
280 00c9 0002 0011 -- flags
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
281 00ca 0004 39c0 0883 -- create time
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 00d1 0002 0200 -- max msg len
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283 00d2 0002 0018 -- max occupants
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
284 00d3 000c -- name
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
285 7a6f 6f6f 6d7a 6f6f 6f6d 3432
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
286 00d5 0001 02 -- creation permission
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
287 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
288 struct aim_tlvlist_t *tlvlist, *innerlist;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
289 char *ck = NULL, *fqcn = NULL, *name = NULL;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
290 unsigned short exchange = 0, instance = 0, unknown = 0, flags = 0, maxmsglen = 0, maxoccupancy = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 unsigned long createtime = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
292 unsigned char createperms = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
293 int i, cklen;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
294 struct aim_tlv_t *bigblock;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
296 i = 10;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
297 if (!(tlvlist = aim_readtlvchain(command->data+i, command->commandlen-i))) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
298 faimdprintf(sess, 0, "unable to read top tlv in create room response\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
299 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
300 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
301
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
302 if (!(bigblock = aim_gettlv(tlvlist, 0x0004, 1))) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
303 faimdprintf(sess, 0, "no bigblock in top tlv in create room response\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
304 aim_freetlvchain(&tlvlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
305 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
306 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
307 i = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
308
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
309 exchange = aimutil_get16(bigblock->value+i);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
310 i += 2;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
311
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
312 cklen = aimutil_get8(bigblock->value+i);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
313 i++;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
314
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
315 ck = malloc(cklen+1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
316 memcpy(ck, bigblock->value+i, cklen);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
317 ck[cklen] = '\0';
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
318 i += cklen;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
319
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
320 instance = aimutil_get16(bigblock->value+i);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
321 i += 2;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
322
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
323 if (aimutil_get8(bigblock->value+i) != 0x02) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
324 faimdprintf(sess, 0, "unknown detaillevel in create room response (0x%02x)\n", aimutil_get8(bigblock->value+i));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
325 aim_freetlvchain(&tlvlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
326 free(ck);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
327 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
328 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
329 i += 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
330
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
331 unknown = aimutil_get16(bigblock->value+i);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
332 i += 2;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
333
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
334 if (!(innerlist = aim_readtlvchain(bigblock->value+i, bigblock->length-i))) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
335 faimdprintf(sess, 0, "unable to read inner tlv chain in create room response\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
336 aim_freetlvchain(&tlvlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
337 free(ck);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
338 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
339 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
340
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
341 if (aim_gettlv(innerlist, 0x006a, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
342 fqcn = aim_gettlv_str(innerlist, 0x006a, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
343
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
344 if (aim_gettlv(innerlist, 0x00c9, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
345 flags = aim_gettlv16(innerlist, 0x00c9, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
346
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
347 if (aim_gettlv(innerlist, 0x00ca, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
348 createtime = aim_gettlv32(innerlist, 0x00ca, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
349
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
350 if (aim_gettlv(innerlist, 0x00d1, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
351 maxmsglen = aim_gettlv16(innerlist, 0x00d1, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
352
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
353 if (aim_gettlv(innerlist, 0x00d2, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
354 maxoccupancy = aim_gettlv16(innerlist, 0x00d2, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
355
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
356 if (aim_gettlv(innerlist, 0x00d3, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
357 name = aim_gettlv_str(innerlist, 0x00d3, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
358
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
359 if (aim_gettlv(innerlist, 0x00d5, 1))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360 createperms = aim_gettlv8(innerlist, 0x00d5, 1);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
361
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
362 if ((userfunc = aim_callhandler(sess, command->conn, 0x000d, 0x0009))) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
363 ret = userfunc(sess, command, snac->type, fqcn, instance, exchange, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name, ck);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
364 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
365
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
366 if (ck)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
367 free(ck);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
368 if (name)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
369 free(name);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
370 if (fqcn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
371 free(fqcn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
372 aim_freetlvchain(&innerlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
373 aim_freetlvchain(&tlvlist);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
374
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
375 break;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
376 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
377 default: /* unknown */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
378 faimdprintf(sess, 0, "chatnav_parse_info: unknown request subtype (%04x)\n", snac->type);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
379 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
380
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
381 if (snac && snac->data)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
382 free(snac->data);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
383 if (snac)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
384 free(snac);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
385
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
386 return ret;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
387 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
388
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
389 faim_export unsigned long aim_chatnav_createroom(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
390 struct aim_conn_t *conn,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
391 char *name,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
392 u_short exchange)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
393 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
394 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
395 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
396
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
397 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 10+12+strlen("invite")+strlen(name))))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
398 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
399
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
400 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
401
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
402 i = aim_putsnac(newpacket->data, 0x000d, 0x0008, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
403
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
404 /* exchange */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
405 i+= aimutil_put16(newpacket->data+i, exchange);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
406
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
407 /* room cookie */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
408 i+= aimutil_put8(newpacket->data+i, strlen("invite"));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
409 i+= aimutil_putstr(newpacket->data+i, "invite", strlen("invite"));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
410
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
411 /* instance */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
412 i+= aimutil_put16(newpacket->data+i, 0xffff);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
413
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
414 /* detail level */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
415 i+= aimutil_put8(newpacket->data+i, 0x01);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
416
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
417 /* tlvcount */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
418 i+= aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
419
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
420 /* room name */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
421 i+= aim_puttlv_str(newpacket->data+i, 0x00d3, strlen(name), name);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
422
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
423 aim_cachesnac(sess, 0x000d, 0x0008, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
424
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
425 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
426
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
427 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
428 }