Remove useless comparison
[pidgin-git.git] / libpurple / protocols / oscar / family_bos.c
blob16defd2076e881f7e8b58290655613f666dcf916
1 /*
2 * Purple's oscar protocol plugin
3 * This file is the legal property of its developers.
4 * Please see the AUTHORS file distributed alongside this file.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 * Family 0x0009 - Basic Oscar Service.
24 * The functionality of this family has been replaced by SSI.
27 #include "oscar.h"
29 #include <string.h>
31 /* Subtype 0x0002 - Request BOS rights. */
32 void
33 aim_bos_reqrights(OscarData *od, FlapConnection *conn)
35 aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_BOS, 0x0002);
38 /* Subtype 0x0003 - BOS Rights. */
39 static int rights(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
41 aim_rxcallback_t userfunc;
42 GSList *tlvlist;
43 guint16 maxpermits = 0, maxdenies = 0;
44 int ret = 0;
47 * TLVs follow
49 tlvlist = aim_tlvlist_read(bs);
52 * TLV type 0x0001: Maximum number of buddies on permit list.
54 if (aim_tlv_gettlv(tlvlist, 0x0001, 1))
55 maxpermits = aim_tlv_get16(tlvlist, 0x0001, 1);
58 * TLV type 0x0002: Maximum number of buddies on deny list.
60 if (aim_tlv_gettlv(tlvlist, 0x0002, 1))
61 maxdenies = aim_tlv_get16(tlvlist, 0x0002, 1);
63 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
64 ret = userfunc(od, conn, frame, maxpermits, maxdenies);
66 aim_tlvlist_free(tlvlist);
68 return ret;
71 static int
72 snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
74 if (snac->subtype == 0x0003)
75 return rights(od, conn, mod, frame, snac, bs);
77 return 0;
80 int
81 bos_modfirst(OscarData *od, aim_module_t *mod)
83 mod->family = SNAC_FAMILY_BOS;
84 mod->version = 0x0001;
85 mod->toolid = 0x0110;
86 mod->toolversion = 0x0629;
87 mod->flags = 0;
88 strncpy(mod->name, "bos", sizeof(mod->name));
89 mod->snachandler = snachandler;
91 return 0;