annotate src/protocols/oscar/family_bos.c @ 13616:ee7f92a706ac

[gaim-migrate @ 16002] Patch from Bj??rn Voigt on gaim-i18n to translate the search instructions that come from the Jabber server. He's provided the string for users.jabber.org, the most common case. This technique is a bit of a hack, but it seems like the best option we've got at the moment. I said I'd commit this as long as nobody objected. Also, there's a fix here in case xmlnode_get_data(instnode) returns NULL. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 10 Apr 2006 23:37:32 +0000
parents 5796551db930
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
1 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
2 * Gaim's oscar protocol plugin
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
3 * This file is the legal property of its developers.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
4 * Please see the AUTHORS file distributed alongside this file.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
5 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
6 * This library is free software; you can redistribute it and/or
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
8 * License as published by the Free Software Foundation; either
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
9 * version 2 of the License, or (at your option) any later version.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
10 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
11 * This library is distributed in the hope that it will be useful,
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
14 * Lesser General Public License for more details.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
15 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
17 * License along with this library; if not, write to the Free Software
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
19 */
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
20
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
21 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
22 * Family 0x0009 - Basic Oscar Service.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
23 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
24 * The functionality of this family has been replaced by SSI.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
25 */
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
26
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
27 #include "oscar.h"
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
28
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
29 #include <string.h>
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
30
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
31 /* Subtype 0x0002 - Request BOS rights. */
13609
5796551db930 [gaim-migrate @ 15995]
Mark Doliner <mark@kingant.net>
parents: 13592
diff changeset
32 void
5796551db930 [gaim-migrate @ 15995]
Mark Doliner <mark@kingant.net>
parents: 13592
diff changeset
33 aim_bos_reqrights(OscarData *od, FlapConnection *conn)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
34 {
13609
5796551db930 [gaim-migrate @ 15995]
Mark Doliner <mark@kingant.net>
parents: 13592
diff changeset
35 aim_genericreq_n_snacid(od, conn, 0x0009, 0x0002);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
36 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
37
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
38 /* Subtype 0x0003 - BOS Rights. */
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
39 static int rights(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
40 {
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
41 aim_rxcallback_t userfunc;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
42 aim_tlvlist_t *tlvlist;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
43 guint16 maxpermits = 0, maxdenies = 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
44 int ret = 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
45
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
46 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
47 * TLVs follow
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
48 */
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
49 tlvlist = aim_tlvlist_read(bs);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
50
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
51 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
52 * TLV type 0x0001: Maximum number of buddies on permit list.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
53 */
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
54 if (aim_tlv_gettlv(tlvlist, 0x0001, 1))
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
55 maxpermits = aim_tlv_get16(tlvlist, 0x0001, 1);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
56
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
57 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
58 * TLV type 0x0002: Maximum number of buddies on deny list.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
59 */
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
60 if (aim_tlv_gettlv(tlvlist, 0x0002, 1))
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
61 maxdenies = aim_tlv_get16(tlvlist, 0x0002, 1);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
62
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
63 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
64 ret = userfunc(od, conn, frame, maxpermits, maxdenies);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
65
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
66 aim_tlvlist_free(&tlvlist);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
67
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
68 return ret;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
69 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
70
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
71 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
72 * Subtype 0x0004 - Set group permission mask.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
73 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
74 * Normally 0x1f (all classes).
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
75 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
76 * The group permission mask allows you to keep users of a certain
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
77 * class or classes from talking to you. The mask should be
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
78 * a bitwise OR of all the user classes you want to see you.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
79 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
80 */
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
81 int aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
82 {
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
83 return aim_genericreq_l(od, conn, 0x0009, 0x0004, &mask);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
84 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
85
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
86 /*
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
87 * Stubtypes 0x0005, 0x0006, 0x0007, and 0x0008 - Modify permit/deny lists.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
88 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
89 * Changes your visibility depending on changetype:
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
90 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
91 * AIM_VISIBILITYCHANGE_PERMITADD: Lets provided list of names see you
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
92 * AIM_VISIBILITYCHANGE_PERMIDREMOVE: Removes listed names from permit list
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
93 * AIM_VISIBILITYCHANGE_DENYADD: Hides you from provided list of names
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
94 * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
95 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
96 * list should be a list of
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
97 * screen names in the form "Screen Name One&ScreenNameTwo&" etc.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
98 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
99 * Equivelents to options in WinAIM:
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
100 * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
101 * with only your name on it.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
102 * - Allow only users on my Buddy List: Send an
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
103 * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
104 * buddy list
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
105 * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
106 * with everyone listed that you want to see you.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
107 * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
108 * yourself in the list
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
109 * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
110 * the list of users to be blocked
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
111 *
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
112 * XXX ye gods.
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
113 */
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
114 int aim_bos_changevisibility(OscarData *od, FlapConnection *conn, int changetype, const char *denylist)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
115 {
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
116 FlapFrame *frame;
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
117 int packlen = 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
118 guint16 subtype;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
119 char *localcpy = NULL, *tmpptr = NULL;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
120 int i;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
121 int listcount;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
122 aim_snacid_t snacid;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
123
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
124 if (!denylist)
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
125 return -EINVAL;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
126
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
127 if (changetype == AIM_VISIBILITYCHANGE_PERMITADD)
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
128 subtype = 0x05;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
129 else if (changetype == AIM_VISIBILITYCHANGE_PERMITREMOVE)
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
130 subtype = 0x06;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
131 else if (changetype == AIM_VISIBILITYCHANGE_DENYADD)
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
132 subtype = 0x07;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
133 else if (changetype == AIM_VISIBILITYCHANGE_DENYREMOVE)
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
134 subtype = 0x08;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
135 else
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
136 return -EINVAL;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
137
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
138 localcpy = strdup(denylist);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
139
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
140 listcount = aimutil_itemcnt(localcpy, '&');
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
141 packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
142
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
143 frame = flap_frame_new(od, 0x02, packlen);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
144
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
145 snacid = aim_cachesnac(od, 0x0009, subtype, 0x0000, NULL, 0);
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
146 aim_putsnac(&frame->data, 0x0009, subtype, 0x00, snacid);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
147
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
148 for (i = 0; (i < (listcount - 1)) && (i < 99); i++) {
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
149 tmpptr = aimutil_itemindex(localcpy, i, '&');
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
150
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
151 byte_stream_put8(&frame->data, strlen(tmpptr));
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
152 byte_stream_putstr(&frame->data, tmpptr);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
153
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
154 free(tmpptr);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
155 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
156 free(localcpy);
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
157
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
158 flap_connection_send(conn, frame);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
159
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
160 return 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
161 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
162
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
163 static int
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
164 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
165 {
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
166 if (snac->subtype == 0x0003)
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
167 return rights(od, conn, mod, frame, snac, bs);
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
168
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
169 return 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
170 }
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
171
13592
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
172 int
6519aeb66b31 [gaim-migrate @ 15978]
Mark Doliner <mark@kingant.net>
parents: 13258
diff changeset
173 bos_modfirst(OscarData *od, aim_module_t *mod)
13258
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
174 {
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
175 mod->family = 0x0009;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
176 mod->version = 0x0001;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
177 mod->toolid = 0x0110;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
178 mod->toolversion = 0x0629;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
179 mod->flags = 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
180 strncpy(mod->name, "bos", sizeof(mod->name));
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
181 mod->snachandler = snachandler;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
182
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
183 return 0;
fccf09946174 [gaim-migrate @ 15624]
Mark Doliner <mark@kingant.net>
parents: 13254
diff changeset
184 }