Mercurial > pidgin
annotate src/protocols/oscar/misc.c @ 2843:87d11d2a7d59
[gaim-migrate @ 2856]
i think we've found our mole
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 04 Dec 2001 07:53:55 +0000 |
parents | 9467e4ee81be |
children | 6d62d4520460 |
rev | line source |
---|---|
2086 | 1 |
2 /* | |
3 * aim_misc.c | |
4 * | |
5 * TODO: Seperate a lot of this into an aim_bos.c. | |
6 * | |
7 * Other things... | |
8 * | |
9 * - Idle setting | |
10 * | |
11 * | |
12 */ | |
13 | |
14 #define FAIM_INTERNAL | |
15 #include <aim.h> | |
16 | |
17 /* | |
18 * aim_bos_setbuddylist(buddylist) | |
19 * | |
20 * This just builds the "set buddy list" command then queues it. | |
21 * | |
22 * buddy_list = "Screen Name One&ScreenNameTwo&"; | |
23 * | |
24 * TODO: Clean this up. | |
25 * | |
26 * XXX: I can't stress the TODO enough. | |
27 * | |
28 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
29 faim_export int aim_bos_setbuddylist(aim_session_t *sess, aim_conn_t *conn, const char *buddy_list) |
2086 | 30 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
31 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
32 aim_snacid_t snacid; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
33 int i, len = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
34 char *localcpy = NULL; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
35 char *tmpptr = NULL; |
2086 | 36 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
37 if (!buddy_list || !(localcpy = strdup(buddy_list))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
38 return -EINVAL; |
2086 | 39 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
40 i = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
41 tmpptr = strtok(localcpy, "&"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
42 while ((tmpptr != NULL) && (i < 150)) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
43 faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
44 len += 1+strlen(tmpptr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
45 i++; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
46 tmpptr = strtok(NULL, "&"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
47 } |
2086 | 48 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
49 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+len))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
50 return -ENOMEM; |
2086 | 51 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
52 snacid = aim_cachesnac(sess, 0x0003, 0x0004, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
53 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
54 aim_putsnac(&fr->data, 0x0003, 0x0004, 0x0000, snacid); |
2086 | 55 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
56 strncpy(localcpy, buddy_list, strlen(buddy_list)+1); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
57 i = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
58 tmpptr = strtok(localcpy, "&"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
59 while ((tmpptr != NULL) & (i < 150)) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
60 faimdprintf(sess, 2, "---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr)); |
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 aimbs_put8(&fr->data, strlen(tmpptr)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
63 aimbs_putraw(&fr->data, tmpptr, strlen(tmpptr)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
64 i++; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
65 tmpptr = strtok(NULL, "&"); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
66 } |
2086 | 67 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
68 aim_tx_enqueue(sess, fr); |
2086 | 69 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
70 free(localcpy); |
2086 | 71 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
72 return 0; |
2086 | 73 } |
74 | |
75 /* | |
76 * aim_bos_setprofile(profile) | |
77 * | |
78 * Gives BOS your profile. | |
79 * | |
80 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
81 faim_export int aim_bos_setprofile(aim_session_t *sess, aim_conn_t *conn, const char *profile, const char *awaymsg, fu16_t caps) |
2086 | 82 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
83 static const char defencoding[] = {"text/aolrtf; charset=\"us-ascii\""}; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
84 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
85 aim_tlvlist_t *tl = NULL; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
86 aim_snacid_t snacid; |
2086 | 87 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
88 /* Build to packet first to get real length */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
89 if (profile) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
90 aim_addtlvtochain_raw(&tl, 0x0001, strlen(defencoding), defencoding); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
91 aim_addtlvtochain_raw(&tl, 0x0002, strlen(profile), profile); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
92 } |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
93 |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
94 /* |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
95 * So here's how this works: |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
96 * - You are away when you have a non-zero-length type 4 TLV stored. |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
97 * - You become unaway when you clear the TLV with a zero-length |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
98 * type 4 TLV. |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
99 * - If you do not send the type 4 TLV, your status does not change |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
100 * (that is, if you were away, you'll remain away). |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
101 */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
102 if (awaymsg) { |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
103 if (strlen(awaymsg)) { |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
104 aim_addtlvtochain_raw(&tl, 0x0003, strlen(defencoding), defencoding); |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
105 aim_addtlvtochain_raw(&tl, 0x0004, strlen(awaymsg), awaymsg); |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
106 } else |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
107 aim_addtlvtochain_noval(&tl, 0x0004); |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
108 } |
2086 | 109 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
110 aim_addtlvtochain_caps(&tl, 0x0005, caps); |
2086 | 111 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
112 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + aim_sizetlvchain(&tl)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
113 return -ENOMEM; |
2086 | 114 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
115 snacid = aim_cachesnac(sess, 0x0002, 0x0004, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
116 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
117 aim_putsnac(&fr->data, 0x0002, 0x004, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
118 aim_writetlvchain(&fr->data, &tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
119 aim_freetlvchain(&tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
120 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
121 aim_tx_enqueue(sess, fr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
122 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
123 return 0; |
2086 | 124 } |
125 | |
126 /* | |
127 * aim_bos_reqbuddyrights() | |
128 * | |
129 * Request Buddy List rights. | |
130 * | |
131 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
132 faim_export int aim_bos_reqbuddyrights(aim_session_t *sess, aim_conn_t *conn) |
2086 | 133 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
134 return aim_genericreq_n(sess, conn, 0x0003, 0x0002); |
2086 | 135 } |
136 | |
137 /* | |
2113 | 138 * Send a warning to destsn. |
139 * | |
140 * Flags: | |
141 * AIM_WARN_ANON Send as an anonymous (doesn't count as much) | |
2086 | 142 * |
2113 | 143 * returns -1 on error (couldn't alloc packet), 0 on success. |
2086 | 144 * |
145 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
146 faim_export int aim_send_warning(aim_session_t *sess, aim_conn_t *conn, const char *destsn, fu32_t flags) |
2086 | 147 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
148 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
149 aim_snacid_t snacid; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
150 fu16_t outflags = 0x0000; |
2086 | 151 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
152 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, strlen(destsn)+13))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
153 return -ENOMEM; |
2086 | 154 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
155 snacid = aim_cachesnac(sess, 0x0004, 0x0008, 0x0000, destsn, strlen(destsn)+1); |
2113 | 156 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
157 aim_putsnac(&fr->data, 0x0004, 0x0008, 0x0000, snacid); |
2086 | 158 |
2113 | 159 if (flags & AIM_WARN_ANON) |
160 outflags |= 0x0001; | |
2086 | 161 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
162 aimbs_put16(&fr->data, outflags); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
163 aimbs_put8(&fr->data, strlen(destsn)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
164 aimbs_putraw(&fr->data, destsn, strlen(destsn)); |
2086 | 165 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
166 aim_tx_enqueue(sess, fr); |
2086 | 167 |
2113 | 168 return 0; |
2086 | 169 } |
170 | |
171 /* | |
172 * Generic routine for sending commands. | |
173 * | |
174 * | |
175 * I know I can do this in a smarter way...but I'm not thinking straight | |
176 * right now... | |
177 * | |
178 * I had one big function that handled all three cases, but then it broke | |
179 * and I split it up into three. But then I fixed it. I just never went | |
180 * back to the single. I don't see any advantage to doing it either way. | |
181 * | |
182 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
183 faim_internal int aim_genericreq_n(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t subtype) |
2086 | 184 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
185 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
186 aim_snacid_t snacid = 0x00000000; |
2086 | 187 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
188 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
189 return -ENOMEM; |
2086 | 190 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
191 aim_putsnac(&fr->data, family, subtype, 0x0000, snacid); |
2086 | 192 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
193 aim_tx_enqueue(sess, fr); |
2086 | 194 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
195 return 0; |
2086 | 196 } |
197 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
198 faim_internal int aim_genericreq_n_snacid(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t subtype) |
2086 | 199 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
200 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
201 aim_snacid_t snacid; |
2086 | 202 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
203 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
204 return -ENOMEM; |
2086 | 205 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
206 snacid = aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
207 aim_putsnac(&fr->data, family, subtype, 0x0000, snacid); |
2086 | 208 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
209 aim_tx_enqueue(sess, fr); |
2086 | 210 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
211 return 0; |
2086 | 212 } |
213 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
214 faim_internal int aim_genericreq_l(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t subtype, fu32_t *longdata) |
2086 | 215 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
216 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
217 aim_snacid_t snacid; |
2086 | 218 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
219 if (!longdata) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
220 return aim_genericreq_n(sess, conn, family, subtype); |
2086 | 221 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
222 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
223 return -ENOMEM; |
2086 | 224 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
225 snacid = aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0); |
2086 | 226 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
227 aim_putsnac(&fr->data, family, subtype, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
228 aimbs_put32(&fr->data, *longdata); |
2086 | 229 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
230 aim_tx_enqueue(sess, fr); |
2086 | 231 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
232 return 0; |
2086 | 233 } |
234 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
235 faim_internal int aim_genericreq_s(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t subtype, fu16_t *shortdata) |
2086 | 236 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
237 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
238 aim_snacid_t snacid; |
2086 | 239 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
240 if (!shortdata) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
241 return aim_genericreq_n(sess, conn, family, subtype); |
2086 | 242 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
243 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
244 return -ENOMEM; |
2086 | 245 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
246 snacid = aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0); |
2086 | 247 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
248 aim_putsnac(&fr->data, family, subtype, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
249 aimbs_put16(&fr->data, *shortdata); |
2086 | 250 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
251 aim_tx_enqueue(sess, fr); |
2086 | 252 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
253 return 0; |
2086 | 254 } |
255 | |
256 /* | |
257 * aim_bos_reqlocaterights() | |
258 * | |
259 * Request Location services rights. | |
260 * | |
261 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
262 faim_export int aim_bos_reqlocaterights(aim_session_t *sess, aim_conn_t *conn) |
2086 | 263 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
264 return aim_genericreq_n(sess, conn, 0x0002, 0x0002); |
2086 | 265 } |
266 | |
267 /* | |
268 * Set directory profile data (not the same as aim_bos_setprofile!) | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
269 * |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
270 * privacy: 1 to allow searching, 0 to disallow. |
2086 | 271 */ |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
272 faim_export int aim_setdirectoryinfo(aim_session_t *sess, aim_conn_t *conn, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy) |
2086 | 273 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
274 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
275 aim_snacid_t snacid; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
276 aim_tlvlist_t *tl = NULL; |
2086 | 277 |
278 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
279 aim_addtlvtochain16(&tl, 0x000a, privacy); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
280 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
281 if (first) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
282 aim_addtlvtochain_raw(&tl, 0x0001, strlen(first), first); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
283 if (last) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
284 aim_addtlvtochain_raw(&tl, 0x0002, strlen(last), last); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
285 if (middle) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
286 aim_addtlvtochain_raw(&tl, 0x0003, strlen(middle), middle); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
287 if (maiden) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
288 aim_addtlvtochain_raw(&tl, 0x0004, strlen(maiden), maiden); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
289 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
290 if (state) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
291 aim_addtlvtochain_raw(&tl, 0x0007, strlen(state), state); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
292 if (city) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
293 aim_addtlvtochain_raw(&tl, 0x0008, strlen(city), city); |
2086 | 294 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
295 if (nickname) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
296 aim_addtlvtochain_raw(&tl, 0x000c, strlen(nickname), nickname); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
297 if (zip) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
298 aim_addtlvtochain_raw(&tl, 0x000d, strlen(zip), zip); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
299 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
300 if (street) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
301 aim_addtlvtochain_raw(&tl, 0x0021, strlen(street), street); |
2086 | 302 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
303 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_sizetlvchain(&tl)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
304 return -ENOMEM; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
305 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
306 snacid = aim_cachesnac(sess, 0x0002, 0x0009, 0x0000, NULL, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
307 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
308 aim_putsnac(&fr->data, 0x0002, 0x0009, 0x0000, snacid); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
309 aim_writetlvchain(&fr->data, &tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
310 aim_freetlvchain(&tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
311 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
312 aim_tx_enqueue(sess, fr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
313 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
314 return 0; |
2086 | 315 } |
316 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
317 /* XXX pass these in better */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
318 faim_export int aim_setuserinterests(aim_session_t *sess, aim_conn_t *conn, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, fu16_t privacy) |
2086 | 319 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
320 aim_frame_t *fr; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
321 aim_snacid_t snacid; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
322 aim_tlvlist_t *tl = NULL; |
2086 | 323 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
324 /* ?? privacy ?? */ |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
325 aim_addtlvtochain16(&tl, 0x000a, privacy); |
2086 | 326 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
327 if (interest1) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
328 aim_addtlvtochain_raw(&tl, 0x0000b, strlen(interest1), interest1); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
329 if (interest2) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
330 aim_addtlvtochain_raw(&tl, 0x0000b, strlen(interest2), interest2); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
331 if (interest3) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
332 aim_addtlvtochain_raw(&tl, 0x0000b, strlen(interest3), interest3); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
333 if (interest4) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
334 aim_addtlvtochain_raw(&tl, 0x0000b, strlen(interest4), interest4); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
335 if (interest5) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
336 aim_addtlvtochain_raw(&tl, 0x0000b, strlen(interest5), interest5); |
2086 | 337 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
338 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_sizetlvchain(&tl)))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
339 return -ENOMEM; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
340 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
341 snacid = aim_cachesnac(sess, 0x0002, 0x000f, 0x0000, NULL, 0); |
2086 | 342 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
343 aim_putsnac(&fr->data, 0x0002, 0x000f, 0x0000, 0); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
344 aim_writetlvchain(&fr->data, &tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
345 aim_freetlvchain(&tl); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
346 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
347 aim_tx_enqueue(sess, fr); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
348 |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
349 return 0; |
2086 | 350 } |
351 | |
352 /* | |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
353 * Should be generic enough to handle the errors for all groups. |
2086 | 354 * |
355 */ | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
356 static int generror(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 357 { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
358 int ret = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
359 int error = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
360 aim_rxcallback_t userfunc; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
361 aim_snac_t *snac2; |
2086 | 362 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
363 snac2 = aim_remsnac(sess, snac->id); |
2086 | 364 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
365 if (aim_bstream_empty(bs)) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
366 error = aimbs_get16(bs); |
2086 | 367 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
368 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
369 ret = userfunc(sess, rx, error, snac2 ? snac2->data : NULL); |
2086 | 370 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
371 if (snac2) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
372 free(snac2->data); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
373 free(snac2); |
2086 | 374 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
375 return ret; |
2086 | 376 } |
377 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
378 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 379 { |
380 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
381 if (snac->subtype == 0x0001) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
382 return generror(sess, mod, rx, snac, bs); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
383 else if ((snac->family == 0xffff) && (snac->subtype == 0xffff)) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
384 aim_rxcallback_t userfunc; |
2086 | 385 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
386 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
387 return userfunc(sess, rx); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
388 } |
2086 | 389 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
390 return 0; |
2086 | 391 } |
392 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
393 faim_internal int misc_modfirst(aim_session_t *sess, aim_module_t *mod) |
2086 | 394 { |
395 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
396 mod->family = 0xffff; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
397 mod->version = 0x0000; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
398 mod->flags = AIM_MODFLAG_MULTIFAMILY; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
399 strncpy(mod->name, "misc", sizeof(mod->name)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
400 mod->snachandler = snachandler; |
2086 | 401 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
402 return 0; |
2086 | 403 } |
2703
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
404 |
441b84ab7f4e
[gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2675
diff
changeset
|
405 |