annotate libfaim/aim_misc.c @ 1258:385c1a1d96aa

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