Mercurial > pidgin
annotate libfaim/aim_misc.c @ 1082:13df4e342cff
[gaim-migrate @ 1092]
oops
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 10 Nov 2000 23:26:57 +0000 |
parents | fa681641643d |
children | 920c86b753d7 |
rev | line source |
---|---|
2 | 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 | |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
14 #include <faim/aim.h> |
2 | 15 |
16 /* | |
17 * aim_bos_setidle() | |
18 * | |
19 * Should set your current idle time in seconds. Idealy, OSCAR should | |
20 * do this for us. But, it doesn't. The client must call this to set idle | |
21 * time. | |
22 * | |
23 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
24 faim_export unsigned long aim_bos_setidle(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
25 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
26 u_long idletime) |
2 | 27 { |
237 | 28 return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime); |
2 | 29 } |
30 | |
31 | |
32 /* | |
33 * aim_bos_changevisibility(conn, changtype, namelist) | |
34 * | |
35 * Changes your visibility depending on changetype: | |
36 * | |
37 * AIM_VISIBILITYCHANGE_PERMITADD: Lets provided list of names see you | |
38 * AIM_VISIBILITYCHANGE_PERMIDREMOVE: Removes listed names from permit list | |
39 * AIM_VISIBILITYCHANGE_DENYADD: Hides you from provided list of names | |
40 * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again | |
41 * | |
42 * list should be a list of | |
43 * screen names in the form "Screen Name One&ScreenNameTwo&" etc. | |
44 * | |
45 * Equivelents to options in WinAIM: | |
46 * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD | |
47 * with only your name on it. | |
48 * - Allow only users on my Buddy List: Send an | |
49 * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your | |
50 * buddy list | |
51 * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD | |
52 * with everyone listed that you want to see you. | |
53 * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only | |
54 * yourself in the list | |
55 * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with | |
56 * the list of users to be blocked | |
57 * | |
58 * | |
59 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
60 faim_export unsigned long aim_bos_changevisibility(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
61 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
62 int changetype, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
63 char *denylist) |
2 | 64 { |
237 | 65 struct command_tx_struct *newpacket; |
66 int packlen = 0; | |
67 u_short subtype; | |
2 | 68 |
69 char *localcpy = NULL; | |
70 char *tmpptr = NULL; | |
71 int i,j; | |
237 | 72 int listcount; |
2 | 73 |
74 if (!denylist) | |
75 return 0; | |
76 | |
77 localcpy = (char *) malloc(strlen(denylist)+1); | |
78 memcpy(localcpy, denylist, strlen(denylist)+1); | |
237 | 79 |
80 listcount = aimutil_itemcnt(localcpy, '&'); | |
81 packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9; | |
2 | 82 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
83 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen))) |
237 | 84 return -1; |
2 | 85 |
237 | 86 newpacket->lock = 1; |
2 | 87 |
88 switch(changetype) | |
89 { | |
237 | 90 case AIM_VISIBILITYCHANGE_PERMITADD: subtype = 0x05; break; |
91 case AIM_VISIBILITYCHANGE_PERMITREMOVE: subtype = 0x06; break; | |
92 case AIM_VISIBILITYCHANGE_DENYADD: subtype = 0x07; break; | |
93 case AIM_VISIBILITYCHANGE_DENYREMOVE: subtype = 0x08; break; | |
2 | 94 default: |
237 | 95 free(newpacket->data); |
96 free(newpacket); | |
2 | 97 return 0; |
98 } | |
237 | 99 |
100 /* We actually DO NOT send a SNAC ID with this one! */ | |
101 aim_putsnac(newpacket->data, 0x0009, subtype, 0x00, 0); | |
2 | 102 |
103 j = 10; /* the next byte */ | |
237 | 104 |
105 for (i=0; (i < (listcount - 1)) && (i < 99); i++) | |
2 | 106 { |
237 | 107 tmpptr = aimutil_itemidx(localcpy, i, '&'); |
108 | |
109 newpacket->data[j] = strlen(tmpptr); | |
110 memcpy(&(newpacket->data[j+1]), tmpptr, strlen(tmpptr)); | |
2 | 111 j += strlen(tmpptr)+1; |
237 | 112 free(tmpptr); |
2 | 113 } |
237 | 114 free(localcpy); |
2 | 115 |
237 | 116 newpacket->lock = 0; |
2 | 117 |
237 | 118 aim_tx_enqueue(sess, newpacket); |
2 | 119 |
237 | 120 return (sess->snac_nextid); /* dont increment */ |
2 | 121 |
122 } | |
123 | |
124 | |
125 | |
126 /* | |
127 * aim_bos_setbuddylist(buddylist) | |
128 * | |
129 * This just builds the "set buddy list" command then queues it. | |
130 * | |
131 * buddy_list = "Screen Name One&ScreenNameTwo&"; | |
132 * | |
237 | 133 * TODO: Clean this up. |
134 * | |
135 * XXX: I can't stress the TODO enough. | |
2 | 136 * |
137 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
138 faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
139 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
140 char *buddy_list) |
2 | 141 { |
142 int i, j; | |
143 | |
237 | 144 struct command_tx_struct *newpacket; |
2 | 145 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
146 int len = 0; |
2 | 147 |
148 char *localcpy = NULL; | |
149 char *tmpptr = NULL; | |
150 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
151 len = 10; /* 10B SNAC headers */ |
2 | 152 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
153 if (!buddy_list || !(localcpy = (char *) malloc(strlen(buddy_list)+1))) |
237 | 154 return -1; |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
155 strncpy(localcpy, buddy_list, strlen(buddy_list)+1); |
2 | 156 |
157 i = 0; | |
158 tmpptr = strtok(localcpy, "&"); | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
159 while ((tmpptr != NULL) && (i < 150)) { |
2 | 160 #if debug > 0 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
161 printf("---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr)); |
2 | 162 #endif |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
163 len += 1+strlen(tmpptr); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
164 i++; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
165 tmpptr = strtok(NULL, "&"); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
166 } |
2 | 167 #if debug > 0 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
168 printf("*** send buddy list len: %d (%x)\n", len, len); |
2 | 169 #endif |
170 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
171 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, len))) |
237 | 172 return -1; |
2 | 173 |
237 | 174 newpacket->lock = 1; |
175 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
176 aim_putsnac(newpacket->data, 0x0003, 0x0004, 0x0000, 0); |
2 | 177 |
178 j = 10; /* the next byte */ | |
179 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
180 strncpy(localcpy, buddy_list, strlen(buddy_list)+1); |
2 | 181 i = 0; |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
182 tmpptr = strtok(localcpy, "&"); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
183 while ((tmpptr != NULL) & (i < 150)) { |
2 | 184 #if debug > 0 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
185 printf("---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr)); |
2 | 186 #endif |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
187 newpacket->data[j] = strlen(tmpptr); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
188 memcpy(&(newpacket->data[j+1]), tmpptr, strlen(tmpptr)); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
189 j += 1+strlen(tmpptr); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
190 i++; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
191 tmpptr = strtok(NULL, "&"); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
192 } |
2 | 193 |
237 | 194 newpacket->lock = 0; |
2 | 195 |
237 | 196 aim_tx_enqueue(sess, newpacket); |
2 | 197 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
198 free(localcpy); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
199 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
200 return (sess->snac_nextid); |
2 | 201 } |
202 | |
203 /* | |
204 * aim_bos_setprofile(profile) | |
205 * | |
206 * Gives BOS your profile. | |
207 * | |
237 | 208 * |
2 | 209 */ |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
210 faim_export unsigned long aim_bos_setprofile(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
211 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
212 char *profile, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
213 char *awaymsg, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
214 unsigned short caps) |
2 | 215 { |
237 | 216 struct command_tx_struct *newpacket; |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
217 int i = 0, tmp, caplen; |
2 | 218 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
219 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152+strlen(profile)+1+(awaymsg?strlen(awaymsg):0)))) |
237 | 220 return -1; |
2 | 221 |
237 | 222 i += aim_putsnac(newpacket->data, 0x0002, 0x004, 0x0000, sess->snac_nextid); |
223 i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen("text/x-aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\""); | |
224 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(profile), profile); | |
225 /* why do we send this twice? */ | |
226 i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen("text/x-aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\""); | |
227 | |
228 /* Away message -- we send this no matter what, even if its blank */ | |
229 if (awaymsg) | |
230 i += aim_puttlv_str(newpacket->data+i, 0x0004, strlen(awaymsg), awaymsg); | |
2 | 231 else |
237 | 232 i += aim_puttlv_str(newpacket->data+i, 0x0004, 0x0000, NULL); |
2 | 233 |
237 | 234 /* Capability information. */ |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
235 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
236 tmp = (i += aimutil_put16(newpacket->data+i, 0x0005)); |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
237 i += aimutil_put16(newpacket->data+i, 0x0000); /* rewritten later */ |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
238 i += (caplen = aim_putcap(newpacket->data+i, 512, caps)); |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
239 aimutil_put16(newpacket->data+tmp, caplen); /* rewrite TLV size */ |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
240 |
237 | 241 newpacket->commandlen = i; |
242 aim_tx_enqueue(sess, newpacket); | |
2 | 243 |
237 | 244 return (sess->snac_nextid++); |
2 | 245 } |
246 | |
247 /* | |
248 * aim_bos_setgroupperm(mask) | |
249 * | |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
250 * Set group permisson mask. Normally 0x1f (all classes). |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
251 * |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
252 * The group permission mask allows you to keep users of a certain |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
253 * class or classes from talking to you. The mask should be |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
254 * a bitwise OR of all the user classes you want to see you. |
2 | 255 * |
256 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
257 faim_export unsigned long aim_bos_setgroupperm(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
258 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
259 u_long mask) |
2 | 260 { |
237 | 261 return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask); |
2 | 262 } |
263 | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
264 faim_internal int aim_parse_bosrights(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
265 struct command_rx_struct *command, ...) |
835
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
266 { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
267 rxcallback_t userfunc = NULL; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
268 int ret=1; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
269 struct aim_tlvlist_t *tlvlist; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
270 struct aim_tlv_t *tlv; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
271 unsigned short maxpermits = 0, maxdenies = 0; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
272 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
273 /* |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
274 * TLVs follow |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
275 */ |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
276 if (!(tlvlist = aim_readtlvchain(command->data+10, command->commandlen-10))) |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
277 return ret; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
278 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
279 /* |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
280 * TLV type 0x0001: Maximum number of buddies on permit list. |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
281 */ |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
282 if ((tlv = aim_gettlv(tlvlist, 0x0001, 1))) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
283 maxpermits = aimutil_get16(tlv->value); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
284 } |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
285 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
286 /* |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
287 * TLV type 0x0002: Maximum number of buddies on deny list. |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
288 * |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
289 */ |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
290 if ((tlv = aim_gettlv(tlvlist, 0x0002, 1))) { |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
291 maxdenies = aimutil_get16(tlv->value); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
292 } |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
293 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
294 userfunc = aim_callhandler(command->conn, 0x0009, 0x0003); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
295 if (userfunc) |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
296 ret = userfunc(sess, command, maxpermits, maxdenies); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
297 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
298 aim_freetlvchain(&tlvlist); |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
299 |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
300 return ret; |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
301 } |
88f8f98de02d
[gaim-migrate @ 845]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
302 |
2 | 303 /* |
304 * aim_bos_clientready() | |
305 * | |
306 * Send Client Ready. | |
307 * | |
308 * TODO: Dynamisize. | |
309 * | |
310 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
311 faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
312 struct aim_conn_t *conn) |
2 | 313 { |
237 | 314 u_char command_2[] = { |
315 /* placeholders for dynamic data */ | |
316 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | |
317 0xff, 0xff, | |
318 /* real data */ | |
319 0x00, 0x01, | |
320 0x00, 0x03, | |
321 0x00, 0x04, | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
322 0x06, 0x86, /* the good ones */ |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
323 #if 0 |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
324 0x07, 0xda, /* DUPLE OF DEATH! */ |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
325 #endif |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
326 |
237 | 327 0x00, 0x02, |
328 0x00, 0x01, | |
329 0x00, 0x04, | |
330 0x00, 0x01, | |
331 | |
332 0x00, 0x03, | |
333 0x00, 0x01, | |
334 0x00, 0x04, | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
335 0x00, 0x01, |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
336 |
237 | 337 0x00, 0x04, |
338 0x00, 0x01, | |
339 0x00, 0x04, | |
340 0x00, 0x01, | |
341 | |
342 0x00, 0x06, | |
343 0x00, 0x01, | |
344 0x00, 0x04, | |
345 0x00, 0x01, | |
346 0x00, 0x08, | |
347 0x00, 0x01, | |
348 0x00, 0x04, | |
349 0x00, 0x01, | |
350 | |
351 0x00, 0x09, | |
352 0x00, 0x01, | |
353 0x00, 0x04, | |
354 0x00, 0x01, | |
355 0x00, 0x0a, | |
356 0x00, 0x01, | |
357 0x00, 0x04, | |
358 0x00, 0x01, | |
359 | |
360 0x00, 0x0b, | |
361 0x00, 0x01, | |
362 0x00, 0x04, | |
2 | 363 0x00, 0x01 |
364 }; | |
365 int command_2_len = 0x52; | |
237 | 366 struct command_tx_struct *newpacket; |
2 | 367 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
368 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, command_2_len))) |
237 | 369 return -1; |
370 | |
371 newpacket->lock = 1; | |
372 | |
373 memcpy(newpacket->data, command_2, command_2_len); | |
2 | 374 |
237 | 375 /* This write over the dynamic parts of the byte block */ |
376 aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid); | |
2 | 377 |
237 | 378 aim_tx_enqueue(sess, newpacket); |
2 | 379 |
237 | 380 return (sess->snac_nextid++); |
2 | 381 } |
382 | |
383 /* | |
384 * Request Rate Information. | |
385 * | |
386 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
387 faim_export unsigned long aim_bos_reqrate(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
388 struct aim_conn_t *conn) |
2 | 389 { |
237 | 390 return aim_genericreq_n(sess, conn, 0x0001, 0x0006); |
2 | 391 } |
392 | |
393 /* | |
394 * Rate Information Response Acknowledge. | |
395 * | |
396 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
397 faim_export unsigned long aim_bos_ackrateresp(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
398 struct aim_conn_t *conn) |
2 | 399 { |
237 | 400 struct command_tx_struct *newpacket; |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
401 int packlen = 20, i=0; |
2 | 402 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
403 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen))) |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
404 return (sess->snac_nextid); |
237 | 405 |
406 newpacket->lock = 1; | |
2 | 407 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
408 i = aim_putsnac(newpacket->data, 0x0001, 0x0008, 0x0000, 0); |
237 | 409 i += aimutil_put16(newpacket->data+i, 0x0001); |
410 i += aimutil_put16(newpacket->data+i, 0x0002); | |
411 i += aimutil_put16(newpacket->data+i, 0x0003); | |
412 i += aimutil_put16(newpacket->data+i, 0x0004); | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
413 i += aimutil_put16(newpacket->data+i, 0x0005); |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
414 |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
415 newpacket->commandlen = i; |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
416 newpacket->lock = 0; |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
417 |
237 | 418 aim_tx_enqueue(sess, newpacket); |
2 | 419 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
420 return (sess->snac_nextid); |
2 | 421 } |
422 | |
423 /* | |
424 * aim_bos_setprivacyflags() | |
425 * | |
426 * Sets privacy flags. Normally 0x03. | |
427 * | |
428 * Bit 1: Allows other AIM users to see how long you've been idle. | |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
429 * Bit 2: Allows other AIM users to see how long you've been a member. |
2 | 430 * |
431 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
432 faim_export unsigned long aim_bos_setprivacyflags(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
433 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
434 u_long flags) |
2 | 435 { |
237 | 436 return aim_genericreq_l(sess, conn, 0x0001, 0x0014, &flags); |
2 | 437 } |
438 | |
439 /* | |
440 * aim_bos_reqpersonalinfo() | |
441 * | |
442 * Requests the current user's information. Can't go generic on this one | |
443 * because aparently it uses SNAC flags. | |
444 * | |
445 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
446 faim_export unsigned long aim_bos_reqpersonalinfo(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
447 struct aim_conn_t *conn) |
2 | 448 { |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
449 return aim_genericreq_n(sess, conn, 0x0001, 0x000e); |
237 | 450 } |
451 | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
452 faim_export unsigned long aim_setversions(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
453 struct aim_conn_t *conn) |
237 | 454 { |
455 struct command_tx_struct *newpacket; | |
456 int i; | |
457 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
458 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10 + (4*12)))) |
237 | 459 return -1; |
460 | |
461 newpacket->lock = 1; | |
462 | |
463 i = aim_putsnac(newpacket->data, 0x0001, 0x0017, 0x0000, sess->snac_nextid); | |
464 | |
465 i += aimutil_put16(newpacket->data+i, 0x0001); | |
466 i += aimutil_put16(newpacket->data+i, 0x0003); | |
467 | |
468 i += aimutil_put16(newpacket->data+i, 0x0002); | |
469 i += aimutil_put16(newpacket->data+i, 0x0001); | |
470 | |
471 i += aimutil_put16(newpacket->data+i, 0x0003); | |
472 i += aimutil_put16(newpacket->data+i, 0x0001); | |
473 | |
474 i += aimutil_put16(newpacket->data+i, 0x0004); | |
475 i += aimutil_put16(newpacket->data+i, 0x0001); | |
2 | 476 |
237 | 477 i += aimutil_put16(newpacket->data+i, 0x0006); |
478 i += aimutil_put16(newpacket->data+i, 0x0001); | |
479 | |
480 i += aimutil_put16(newpacket->data+i, 0x0008); | |
481 i += aimutil_put16(newpacket->data+i, 0x0001); | |
482 | |
483 i += aimutil_put16(newpacket->data+i, 0x0009); | |
484 i += aimutil_put16(newpacket->data+i, 0x0001); | |
485 | |
486 i += aimutil_put16(newpacket->data+i, 0x000a); | |
487 i += aimutil_put16(newpacket->data+i, 0x0001); | |
488 | |
489 i += aimutil_put16(newpacket->data+i, 0x000b); | |
490 i += aimutil_put16(newpacket->data+i, 0x0002); | |
2 | 491 |
237 | 492 i += aimutil_put16(newpacket->data+i, 0x000c); |
493 i += aimutil_put16(newpacket->data+i, 0x0001); | |
494 | |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
495 i += aimutil_put16(newpacket->data+i, 0x0013); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
496 i += aimutil_put16(newpacket->data+i, 0x0001); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
497 |
237 | 498 i += aimutil_put16(newpacket->data+i, 0x0015); |
499 i += aimutil_put16(newpacket->data+i, 0x0001); | |
2 | 500 |
237 | 501 #if 0 |
502 for (j = 0; j < 0x10; j++) { | |
503 i += aimutil_put16(newpacket->data+i, j); /* family */ | |
504 i += aimutil_put16(newpacket->data+i, 0x0003); /* version */ | |
505 } | |
506 #endif | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
507 |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
508 newpacket->commandlen = i; |
237 | 509 newpacket->lock = 0; |
510 aim_tx_enqueue(sess, newpacket); | |
2 | 511 |
237 | 512 return (sess->snac_nextid++); |
2 | 513 } |
514 | |
237 | 515 |
2 | 516 /* |
517 * aim_bos_reqservice(serviceid) | |
518 * | |
519 * Service request. | |
520 * | |
521 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
522 faim_export unsigned long aim_bos_reqservice(struct aim_session_t *sess, |
237 | 523 struct aim_conn_t *conn, |
524 u_short serviceid) | |
2 | 525 { |
237 | 526 return aim_genericreq_s(sess, conn, 0x0001, 0x0004, &serviceid); |
2 | 527 } |
528 | |
529 /* | |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
530 * aim_bos_nop() |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
531 * |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
532 * No-op. WinAIM sends these every 4min or so to keep |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
533 * the connection alive. Its not real necessary. |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
534 * |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
535 */ |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
536 faim_export unsigned long aim_bos_nop(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
537 struct aim_conn_t *conn) |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
538 { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
539 return aim_genericreq_n(sess, conn, 0x0001, 0x0016); |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
540 } |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
541 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
542 /* |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
543 * aim_flap_nop() |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
544 * |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
545 * No-op. WinAIM 4.x sends these _every minute_ to keep |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
546 * the connection alive. |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
547 */ |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
548 faim_export unsigned long aim_flap_nop(struct aim_session_t *sess, |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
549 struct aim_conn_t *conn) |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
550 { |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
551 struct command_tx_struct *newpacket; |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
552 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
553 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0005, conn, 0))) |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
554 return sess->snac_nextid; |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
555 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
556 newpacket->lock = 1; |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
557 newpacket->commandlen = 0; |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
558 newpacket->lock = 0; |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
559 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
560 aim_tx_enqueue(sess, newpacket); |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
561 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
562 return (sess->snac_nextid); |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
563 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
564 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
889
diff
changeset
|
565 /* |
2 | 566 * aim_bos_reqrights() |
567 * | |
568 * Request BOS rights. | |
569 * | |
570 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
571 faim_export unsigned long aim_bos_reqrights(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
572 struct aim_conn_t *conn) |
2 | 573 { |
237 | 574 return aim_genericreq_n(sess, conn, 0x0009, 0x0002); |
2 | 575 } |
576 | |
577 /* | |
578 * aim_bos_reqbuddyrights() | |
579 * | |
580 * Request Buddy List rights. | |
581 * | |
582 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
583 faim_export unsigned long aim_bos_reqbuddyrights(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
584 struct aim_conn_t *conn) |
2 | 585 { |
237 | 586 return aim_genericreq_n(sess, conn, 0x0003, 0x0002); |
2 | 587 } |
588 | |
589 /* | |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
590 * aim_send_warning(struct aim_session_t *sess, |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
591 * struct aim_conn_t *conn, char *destsn, int anon) |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
592 * send a warning to destsn. |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
593 * anon is anonymous or not; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
594 * AIM_WARN_ANON anonymous |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
595 * |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
596 * returns -1 on error (couldn't alloc packet), next snacid on success. |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
597 * |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
598 */ |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
599 faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon) |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
600 { |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
601 struct command_tx_struct *newpacket; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
602 int curbyte; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
603 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
604 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, strlen(destsn)+13))) |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
605 return -1; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
606 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
607 newpacket->lock = 1; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
608 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
609 curbyte = 0; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
610 curbyte += aim_putsnac(newpacket->data+curbyte, |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
611 0x0004, 0x0008, 0x0000, sess->snac_nextid); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
612 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
613 curbyte += aimutil_put16(newpacket->data+curbyte, (anon & AIM_WARN_ANON)?1:0); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
614 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
615 curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn)); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
616 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
617 curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn)); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
618 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
619 newpacket->commandlen = curbyte; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
620 newpacket->lock = 0; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
621 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
622 aim_tx_enqueue(sess, newpacket); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
623 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
624 return (sess->snac_nextid++); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
625 } |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
626 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
627 /* |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
628 * aim_debugconn_sendconnect() |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
629 * |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
630 * For aimdebugd. If you don't know what it is, you don't want to. |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
631 */ |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
632 faim_export unsigned long aim_debugconn_sendconnect(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
633 struct aim_conn_t *conn) |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
634 { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
635 return aim_genericreq_n(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEBUGCONN_CONNECT); |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
636 } |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
637 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
638 /* |
2 | 639 * Generic routine for sending commands. |
640 * | |
641 * | |
642 * I know I can do this in a smarter way...but I'm not thinking straight | |
643 * right now... | |
644 * | |
645 * I had one big function that handled all three cases, but then it broke | |
646 * and I split it up into three. But then I fixed it. I just never went | |
647 * back to the single. I don't see any advantage to doing it either way. | |
648 * | |
649 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
650 faim_internal unsigned long aim_genericreq_n(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
651 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
652 u_short family, u_short subtype) |
2 | 653 { |
237 | 654 struct command_tx_struct *newpacket; |
2 | 655 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
656 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10))) |
237 | 657 return 0; |
658 | |
659 newpacket->lock = 1; | |
2 | 660 |
237 | 661 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid); |
662 | |
663 aim_tx_enqueue(sess, newpacket); | |
664 return (sess->snac_nextid++); | |
2 | 665 } |
666 | |
667 /* | |
668 * | |
669 * | |
670 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
671 faim_internal unsigned long aim_genericreq_l(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
672 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
673 u_short family, u_short subtype, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
674 u_long *longdata) |
2 | 675 { |
237 | 676 struct command_tx_struct *newpacket; |
2 | 677 u_long newlong; |
678 | |
679 /* If we don't have data, there's no reason to use this function */ | |
680 if (!longdata) | |
237 | 681 return aim_genericreq_n(sess, conn, family, subtype); |
2 | 682 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
683 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_long)))) |
237 | 684 return -1; |
2 | 685 |
237 | 686 newpacket->lock = 1; |
687 | |
688 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid); | |
2 | 689 |
690 /* copy in data */ | |
691 newlong = htonl(*longdata); | |
237 | 692 memcpy(&(newpacket->data[10]), &newlong, sizeof(u_long)); |
2 | 693 |
237 | 694 aim_tx_enqueue(sess, newpacket); |
695 return (sess->snac_nextid++); | |
2 | 696 } |
697 | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
698 faim_internal unsigned long aim_genericreq_s(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
699 struct aim_conn_t *conn, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
700 u_short family, u_short subtype, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
701 u_short *shortdata) |
2 | 702 { |
237 | 703 struct command_tx_struct *newpacket; |
2 | 704 u_short newshort; |
705 | |
706 /* If we don't have data, there's no reason to use this function */ | |
707 if (!shortdata) | |
237 | 708 return aim_genericreq_n(sess, conn, family, subtype); |
2 | 709 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
710 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_short)))) |
237 | 711 return -1; |
2 | 712 |
237 | 713 newpacket->lock = 1; |
714 | |
715 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid); | |
2 | 716 |
717 /* copy in data */ | |
718 newshort = htons(*shortdata); | |
237 | 719 memcpy(&(newpacket->data[10]), &newshort, sizeof(u_short)); |
2 | 720 |
237 | 721 aim_tx_enqueue(sess, newpacket); |
722 return (sess->snac_nextid++); | |
2 | 723 } |
724 | |
725 /* | |
726 * aim_bos_reqlocaterights() | |
727 * | |
728 * Request Location services rights. | |
729 * | |
730 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
731 faim_export unsigned long aim_bos_reqlocaterights(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
732 struct aim_conn_t *conn) |
2 | 733 { |
237 | 734 return aim_genericreq_n(sess, conn, 0x0002, 0x0002); |
2 | 735 } |
736 | |
737 /* | |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
738 * aim_bos_reqicbmparaminfo() |
2 | 739 * |
740 * Request ICBM parameter information. | |
741 * | |
742 */ | |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
743 faim_export unsigned long aim_bos_reqicbmparaminfo(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
744 struct aim_conn_t *conn) |
2 | 745 { |
237 | 746 return aim_genericreq_n(sess, conn, 0x0004, 0x0004); |
2 | 747 } |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
748 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
749 /* |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
750 * Add ICBM parameter? Huh? |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
751 */ |
889
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
752 faim_export unsigned long aim_addicbmparam(struct aim_session_t *sess, |
e1da6a6ec42b
[gaim-migrate @ 899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
835
diff
changeset
|
753 struct aim_conn_t *conn) |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
754 { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
755 struct command_tx_struct *newpacket; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
756 int packlen = 10+16, i=0; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
757 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
758 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen))) |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
759 return (sess->snac_nextid); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
760 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
761 newpacket->lock = 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
762 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
763 i = aim_putsnac(newpacket->data, 0x0004, 0x0002, 0x0000, sess->snac_nextid); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
764 i += aimutil_put16(newpacket->data+i, 0x0000); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
765 i += aimutil_put16(newpacket->data+i, 0x0000); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
766 i += aimutil_put16(newpacket->data+i, 0x0003); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
767 i += aimutil_put16(newpacket->data+i, 0x1f40); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
768 i += aimutil_put16(newpacket->data+i, 0x03e7); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
769 i += aimutil_put16(newpacket->data+i, 0x03e7); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
770 i += aimutil_put16(newpacket->data+i, 0x0000); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
771 i += aimutil_put16(newpacket->data+i, 0x0000); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
772 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
773 aim_tx_enqueue(sess, newpacket); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
774 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
775 return (sess->snac_nextid); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
771
diff
changeset
|
776 } |
931
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
777 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
778 /* |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
779 * Set directory profile data (not the same as aim_bos_setprofile!) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
780 */ |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
781 faim_export unsigned long aim_setdirectoryinfo(struct aim_session_t *sess, struct aim_conn_t *conn, char *first, char *middle, char *last, char *maiden, char *nickname, char *street, char *city, char *state, char *zip, int country, unsigned short privacy) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
782 { |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
783 struct command_tx_struct *newpacket; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
784 int packlen = 0, i = 0; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
785 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
786 packlen += 2+2+2; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
787 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
788 if(first) /* TLV 0001 */ |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
789 packlen += (strlen(first) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
790 if(middle) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
791 packlen += (strlen(middle) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
792 if(last) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
793 packlen += (strlen(last) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
794 if(maiden) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
795 packlen += (strlen(maiden) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
796 if(nickname) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
797 packlen += (strlen(nickname) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
798 if(street) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
799 packlen += (strlen(street) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
800 if(state) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
801 packlen += (strlen(state) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
802 if(city) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
803 packlen += (strlen(city) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
804 if(zip) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
805 packlen += (strlen(zip) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
806 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
807 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen+10))) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
808 return -1; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
809 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
810 newpacket->lock = 1; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
811 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
812 i = aim_putsnac(newpacket->data, 0x0002, 0x0009, 0x0000, 0); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
813 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
814 /* 000a/0002: privacy: 1 to allow search/disp, 0 to disallow */ |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
815 i += aim_puttlv_16(newpacket->data+i, 0x000a, privacy); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
816 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
817 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
818 if (first) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
819 i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen(first), first); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
820 if (middle) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
821 i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen(middle), middle); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
822 if (last) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
823 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(last), last); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
824 if (maiden) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
825 i += aim_puttlv_str(newpacket->data+i, 0x0004, strlen(maiden), maiden); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
826 if (nickname) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
827 i += aim_puttlv_str(newpacket->data+i, 0x000c, strlen(nickname), nickname); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
828 if (street) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
829 i += aim_puttlv_str(newpacket->data+i, 0x0021, strlen(street), street); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
830 if (city) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
831 i += aim_puttlv_str(newpacket->data+i, 0x0008, strlen(city), city); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
832 if (state) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
833 i += aim_puttlv_str(newpacket->data+i, 0x0007, strlen(state), state); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
834 if (zip) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
835 i += aim_puttlv_str(newpacket->data+i, 0x000d, strlen(zip), zip); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
836 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
837 newpacket->commandlen = i; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
838 newpacket->lock = 0; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
839 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
840 aim_tx_enqueue(sess, newpacket); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
841 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
842 return(sess->snac_nextid); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
843 } |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
844 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
845 faim_export unsigned long aim_setuserinterests(struct aim_session_t *sess, struct aim_conn_t *conn, char *interest1, char *interest2, char *interest3, char *interest4, char *interest5, unsigned short privacy) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
846 { |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
847 struct command_tx_struct *newpacket; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
848 int packlen = 0, i = 0; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
849 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
850 packlen += 2+2+2; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
851 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
852 if(interest1) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
853 packlen += (strlen(interest1) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
854 if(interest2) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
855 packlen += (strlen(interest2) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
856 if(interest3) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
857 packlen += (strlen(interest3) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
858 if(interest4) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
859 packlen += (strlen(interest4) + 4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
860 if(interest5) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
861 packlen += (strlen(interest5) + 4) ; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
862 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
863 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
864 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen+10))) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
865 return -1; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
866 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
867 newpacket->lock = 1; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
868 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
869 i = aim_putsnac(newpacket->data, 0x0002, 0x000f, 0x0000, 0); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
870 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
871 /* 000a/0002: 0000 ?? ?privacy? */ |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
872 i += aim_puttlv_16(newpacket->data+i, 0x000a, privacy); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
873 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
874 if(interest1) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
875 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest1), interest1); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
876 if(interest2) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
877 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest2), interest2); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
878 if(interest3) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
879 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest3), interest3); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
880 if(interest4) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
881 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest4), interest4); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
882 if(interest5) |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
883 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest1), interest5); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
884 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
885 newpacket->commandlen = i; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
886 newpacket->lock = 0; |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
887 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
888 aim_tx_enqueue(sess, newpacket); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
889 |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
890 return(sess->snac_nextid); |
59d9e1177ab5
[gaim-migrate @ 941]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
891 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
892 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
893 faim_export unsigned long aim_icq_setstatus(struct aim_session_t *sess, |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
894 struct aim_conn_t *conn, |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
895 unsigned long status) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
896 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
897 struct command_tx_struct *newpacket; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
898 int i; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
899 unsigned long data; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
900 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
901 data = 0x00030000 | status; /* yay for error checking ;^) */ |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
902 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
903 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10 + 4))) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
904 return -1; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
905 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
906 newpacket->lock = 1; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
907 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
908 i = aim_putsnac(newpacket->data, 0x0001, 0x001e, 0x0000, 0x0000001e); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
909 i += aim_puttlv_32(newpacket->data+i, 0x0006, data); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
910 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
911 newpacket->commandlen = i; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
912 newpacket->lock = 0; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
913 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
914 aim_tx_enqueue(sess, newpacket); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
915 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
916 return(sess->snac_nextid); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
931
diff
changeset
|
917 } |