summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Komarov <ivan.komarov@pidgin.im>2010-07-28 18:59:39 +0000
committerIvan Komarov <ivan.komarov@pidgin.im>2010-07-28 18:59:39 +0000
commit40e2abb016207f529cbba53767b485d07d8bd25e (patch)
tree893af45352b0507890fbd45273c4f99cbeb05949
parent7f3cf58c577da759b38de5a70c6c1a2e039b064d (diff)
downloadpidgin-40e2abb016207f529cbba53767b485d07d8bd25e.tar.gz
Turns out that ncc doesn't catch everything, so continue killing things mercilessly.
Removed AIM_CHATROOM_FLAG_* defines and everything that wasn't used in purple_conv_chat_info_update() (pretty much all contents of a packet). Also, removed unused aim_util_*() and aim_chat_getconn() functions.
-rw-r--r--libpurple/protocols/oscar/family_chat.c153
-rw-r--r--libpurple/protocols/oscar/oscar.c17
-rw-r--r--libpurple/protocols/oscar/oscar.h14
-rw-r--r--libpurple/protocols/oscar/util.c85
4 files changed, 2 insertions, 267 deletions
diff --git a/libpurple/protocols/oscar/family_chat.c b/libpurple/protocols/oscar/family_chat.c
index 604d84e631..29f489b5d8 100644
--- a/libpurple/protocols/oscar/family_chat.c
+++ b/libpurple/protocols/oscar/family_chat.c
@@ -47,36 +47,6 @@ flap_connection_destroy_chat(OscarData *od, FlapConnection *conn)
return;
}
-/* XXX get this into conn.c -- evil!! */
-FlapConnection *
-aim_chat_getconn(OscarData *od, const char *name)
-{
- GSList *cur;
-
- for (cur = od->oscar_connections; cur; cur = cur->next)
- {
- FlapConnection *conn;
- struct chatconnpriv *ccp;
-
- conn = cur->data;
- ccp = (struct chatconnpriv *)conn->internal;
-
- if (conn->type != SNAC_FAMILY_CHAT)
- continue;
- if (!conn->internal)
- {
- purple_debug_misc("oscar", "%sfaim: chat: chat connection with no name! (fd = %d)\n",
- conn->gsc ? "(ssl) " : "", conn->gsc ? conn->gsc->fd : conn->fd);
- continue;
- }
-
- if (strcmp(ccp->name, name) == 0)
- return conn;
- }
-
- return NULL;
-}
-
int
aim_chat_readroominfo(ByteStream *bs, struct aim_chat_roominfo *outinfo)
{
@@ -102,21 +72,12 @@ aim_chat_readroominfo(ByteStream *bs, struct aim_chat_roominfo *outinfo)
static int
infoupdate(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
{
- aim_userinfo_t *userinfo = NULL;
aim_rxcallback_t userfunc;
int ret = 0;
- int usercount;
guint8 detaillevel = 0;
- char *roomname;
struct aim_chat_roominfo roominfo;
- guint16 tlvcount = 0;
GSList *tlvlist;
- aim_tlv_t *tlv;
- char *roomdesc;
- guint16 flags;
- guint32 creationtime;
guint16 maxmsglen, maxvisiblemsglen;
- guint16 unknown_d2, unknown_d5;
aim_chat_readroominfo(bs, &roominfo);
@@ -127,139 +88,27 @@ infoupdate(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *fr
return 1;
}
- tlvcount = byte_stream_get16(bs);
-
/*
* Everything else are TLVs.
*/
tlvlist = aim_tlvlist_read(bs);
/*
- * TLV type 0x006a is the room name in Human Readable Form.
- */
- roomname = aim_tlv_getstr(tlvlist, 0x006a, 1);
-
- /*
- * Type 0x006f: Number of occupants.
- */
- usercount = aim_tlv_get16(tlvlist, 0x006f, 1);
-
- /*
- * Type 0x0073: Occupant list.
- */
- tlv = aim_tlv_gettlv(tlvlist, 0x0073, 1);
- if (tlv != NULL)
- {
- int curoccupant = 0;
- ByteStream occbs;
-
- /* Allocate enough userinfo structs for all occupants */
- userinfo = g_new0(aim_userinfo_t, usercount);
-
- byte_stream_init(&occbs, tlv->value, tlv->length);
-
- while (curoccupant < usercount)
- aim_info_extract(od, &occbs, &userinfo[curoccupant++]);
- }
-
- /*
- * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG)
- */
- flags = aim_tlv_get16(tlvlist, 0x00c9, 1);
-
- /*
- * Type 0x00ca: Creation time (4 bytes)
- */
- creationtime = aim_tlv_get32(tlvlist, 0x00ca, 1);
-
- /*
* Type 0x00d1: Maximum Message Length
*/
maxmsglen = aim_tlv_get16(tlvlist, 0x00d1, 1);
/*
- * Type 0x00d2: Unknown. (2 bytes)
- */
- unknown_d2 = aim_tlv_get16(tlvlist, 0x00d2, 1);
-
- /*
- * Type 0x00d3: Room Description
- */
- roomdesc = aim_tlv_getstr(tlvlist, 0x00d3, 1);
-
-#if 0
- /*
- * Type 0x000d4: Unknown (flag only)
- */
- if (aim_tlv_gettlv(tlvlist, 0x000d4, 1)) {
- /* Unhandled */
- }
-#endif
-
- /*
- * Type 0x00d5: Unknown. (1 byte)
- */
- unknown_d5 = aim_tlv_get8(tlvlist, 0x00d5, 1);
-
-#if 0
- /*
- * Type 0x00d6: Encoding 1 ("us-ascii")
- */
- if (aim_tlv_gettlv(tlvlist, 0x000d6, 1)) {
- /* Unhandled */
- }
-
- /*
- * Type 0x00d7: Language 1 ("en")
- */
- if (aim_tlv_gettlv(tlvlist, 0x000d7, 1)) {
- /* Unhandled */
- }
-
- /*
- * Type 0x00d8: Encoding 2 ("us-ascii")
- */
- if (aim_tlv_gettlv(tlvlist, 0x000d8, 1)) {
- /* Unhandled */
- }
-
- /*
- * Type 0x00d9: Language 2 ("en")
- */
- if (aim_tlv_gettlv(tlvlist, 0x000d9, 1)) {
- /* Unhandled */
- }
-#endif
-
- /*
* Type 0x00da: Maximum visible message length
*/
maxvisiblemsglen = aim_tlv_get16(tlvlist, 0x00da, 1);
if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) {
- ret = userfunc(od, conn,
- frame,
- &roominfo,
- roomname,
- usercount,
- userinfo,
- roomdesc,
- flags,
- creationtime,
- maxmsglen,
- unknown_d2,
- unknown_d5,
- maxvisiblemsglen);
+ ret = userfunc(od, conn, frame, maxmsglen, maxvisiblemsglen);
}
g_free(roominfo.name);
- while (usercount > 0)
- aim_info_free(&userinfo[--usercount]);
-
- g_free(userinfo);
- g_free(roomname);
- g_free(roomdesc);
aim_tlvlist_free(tlvlist);
return ret;
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
index 8d5510240b..fe81420aff 100644
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -2512,13 +2512,7 @@ static int purple_conv_chat_leave(OscarData *od, FlapConnection *conn, FlapFrame
static int purple_conv_chat_info_update(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
va_list ap;
- aim_userinfo_t *userinfo;
- struct aim_chat_roominfo *roominfo;
- char *roomname;
- int usercount;
- char *roomdesc;
- guint16 unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
- guint32 creationtime;
+ guint16 maxmsglen, maxvisiblemsglen;
PurpleConnection *gc = od->gc;
struct chat_connection *ccon = find_oscar_chat_by_conn(gc, conn);
@@ -2526,16 +2520,7 @@ static int purple_conv_chat_info_update(OscarData *od, FlapConnection *conn, Fla
return 1;
va_start(ap, fr);
- roominfo = va_arg(ap, struct aim_chat_roominfo *);
- roomname = va_arg(ap, char *);
- usercount= va_arg(ap, int);
- userinfo = va_arg(ap, aim_userinfo_t *);
- roomdesc = va_arg(ap, char *);
- unknown_c9 = (guint16)va_arg(ap, unsigned int);
- creationtime = va_arg(ap, guint32);
maxmsglen = (guint16)va_arg(ap, unsigned int);
- unknown_d2 = (guint16)va_arg(ap, unsigned int);
- unknown_d5 = (guint16)va_arg(ap, unsigned int);
maxvisiblemsglen = (guint16)va_arg(ap, unsigned int);
va_end(ap);
diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h
index 4e26e618ff..ed77da9680 100644
--- a/libpurple/protocols/oscar/oscar.h
+++ b/libpurple/protocols/oscar/oscar.h
@@ -1138,16 +1138,6 @@ int icq_im_xstatus_request(OscarData *od, const char *sn);
/* 0x000a - family_userlookup.c */
int aim_search_address(OscarData *, const char *);
-
-
-/* 0x000d - family_chatnav.c */
-/* 0x000e - family_chat.c */
-/* These apply to exchanges as well. */
-#define AIM_CHATROOM_FLAG_EVILABLE 0x0001
-#define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002
-#define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004
-#define AIM_CHATROOM_FLAG_OCCUPANT_PEEK_ALLOWED 0x0008
-
struct aim_chat_exchangeinfo
{
guint16 number;
@@ -1163,7 +1153,6 @@ struct aim_chat_exchangeinfo
#define AIM_CHATFLAGS_AWAY 0x0002
int aim_chat_send_im(OscarData *od, FlapConnection *conn, guint16 flags, const gchar *msg, int msglen, const char *encoding, const char *language);
int aim_chat_join(OscarData *od, guint16 exchange, const char *roomname, guint16 instance);
-FlapConnection *aim_chat_getconn(OscarData *, const char *name);
void aim_chatnav_reqrights(OscarData *od, FlapConnection *conn);
@@ -1472,9 +1461,6 @@ const char *oscar_get_ui_info_string(const char *str, const char *default_value)
gchar *oscar_get_clientstring(void);
guint16 aimutil_iconsum(const guint8 *buf, int buflen);
-int aimutil_tokslen(char *toSearch, int theindex, char dl);
-int aimutil_itemcnt(char *toSearch, char dl);
-char *aimutil_itemindex(char *toSearch, int theindex, char dl);
gboolean oscar_util_valid_name(const char *bn);
gboolean oscar_util_valid_name_icq(const char *bn);
diff --git a/libpurple/protocols/oscar/util.c b/libpurple/protocols/oscar/util.c
index a30ec44dca..ce01a36f6b 100644
--- a/libpurple/protocols/oscar/util.c
+++ b/libpurple/protocols/oscar/util.c
@@ -107,91 +107,6 @@ gchar *oscar_get_clientstring(void)
return g_strdup_printf("%s/%s", name, version);;
}
-/*
- * Tokenizing functions. Used to portably replace strtok/sep.
- * -- DMP.
- *
- */
-/* TODO: Get rid of this and use glib functions */
-int
-aimutil_tokslen(char *toSearch, int theindex, char dl)
-{
- int curCount = 1;
- char *next;
- char *last;
- int toReturn;
-
- last = toSearch;
- next = strchr(toSearch, dl);
-
- while(curCount < theindex && next != NULL) {
- curCount++;
- last = next + 1;
- next = strchr(last, dl);
- }
-
- if ((curCount < theindex) || (next == NULL))
- toReturn = strlen(toSearch) - (curCount - 1);
- else
- toReturn = next - toSearch - (curCount - 1);
-
- return toReturn;
-}
-
-int
-aimutil_itemcnt(char *toSearch, char dl)
-{
- int curCount;
- char *next;
-
- curCount = 1;
-
- next = strchr(toSearch, dl);
-
- while(next != NULL) {
- curCount++;
- next = strchr(next + 1, dl);
- }
-
- return curCount;
-}
-
-char *
-aimutil_itemindex(char *toSearch, int theindex, char dl)
-{
- int curCount;
- char *next;
- char *last;
- char *toReturn;
-
- curCount = 0;
-
- last = toSearch;
- next = strchr(toSearch, dl);
-
- while (curCount < theindex && next != NULL) {
- curCount++;
- last = next + 1;
- next = strchr(last, dl);
- }
- next = strchr(last, dl);
-
- if (curCount < theindex) {
- toReturn = g_malloc(sizeof(char));
- *toReturn = '\0';
- } else {
- if (next == NULL) {
- toReturn = g_malloc((strlen(last) + 1) * sizeof(char));
- strcpy(toReturn, last);
- } else {
- toReturn = g_malloc((next - last + 1) * sizeof(char));
- memcpy(toReturn, last, (next - last));
- toReturn[next - last] = '\0';
- }
- }
- return toReturn;
-}
-
/**
* Calculate the checksum of a given icon.
*/