Mercurial > pidgin.yaz
changeset 1552:b669f48f0990
[gaim-migrate @ 1562]
fix for stupidity. not sure if add/remove buddies works yet (code is there but it's very untested)
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 09 Mar 2001 12:10:56 +0000 |
parents | 497a074fa1c8 |
children | bf10d0673d34 |
files | plugins/yay/internal.h plugins/yay/misc.c plugins/yay/rxhandlers.c plugins/yay/yay.c |
diffstat | 4 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/yay/internal.h Fri Mar 09 09:58:35 2001 +0000 +++ b/plugins/yay/internal.h Fri Mar 09 12:10:56 2001 +0000 @@ -65,8 +65,8 @@ #define YAHOO_MESSAGE_NORMAL 1 -void yahoo_storeint(char *, guint); -int yahoo_makeint(char *); +void yahoo_storeint(guchar *, guint); +int yahoo_makeint(guchar *); struct yahoo_packet { char version[8];
--- a/plugins/yay/misc.c Fri Mar 09 09:58:35 2001 +0000 +++ b/plugins/yay/misc.c Fri Mar 09 12:10:56 2001 +0000 @@ -53,12 +53,12 @@ return ret; } -int yahoo_makeint(char *buf) +int yahoo_makeint(guchar *buf) { return ((buf[3] << 24) + (buf[2] << 16) + (buf[1] << 8) + buf[0]); } -void yahoo_storeint(char *buf, guint data) +void yahoo_storeint(guchar *buf, guint data) { int i; for (i = 0; i < 4; i++) {
--- a/plugins/yay/rxhandlers.c Fri Mar 09 09:58:35 2001 +0000 +++ b/plugins/yay/rxhandlers.c Fri Mar 09 12:10:56 2001 +0000 @@ -268,6 +268,7 @@ g_free(buf); } else if (conn->type == YAHOO_CONN_TYPE_MAIN) { struct yahoo_packet pkt; + guchar temp; int len; if ((read(socket, &pkt, 8) != 8) || strcmp(pkt.version, "YHOO1.0")) { @@ -282,7 +283,6 @@ return; } len = yahoo_makeint(pkt.len); - len = ntohs(len) >> 8; if (read(socket, &pkt.service, len - 12) != len - 12) { yahoo_close(session, conn);
--- a/plugins/yay/yay.c Fri Mar 09 09:58:35 2001 +0000 +++ b/plugins/yay/yay.c Fri Mar 09 12:10:56 2001 +0000 @@ -439,22 +439,22 @@ } static void gyahoo_add_buddy(struct gaim_connection *gc, char *name) { - /* struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; - struct yahoo_buddy *tmpbuddy; + struct yahoo_group *tmpgroup; struct group *g = find_group_by_buddy(gc, name); char *group = NULL; if (g) { group = g->name; - } else if (yd->sess && yd->sess->buddies[0]) { - tmpbuddy = yd->sess->buddies[0]; - group = tmpbuddy->group; + } else if (yd->sess && yd->sess->groups) { + tmpgroup = yd->sess->groups->data; + group = tmpgroup->name; + } else { + group = "Buddies"; } if (group) - yahoo_add_buddy(yd->ctxt, name, yd->active_id, group, ""); - */ + yahoo_add_buddy(yd->sess, yd->active_id, name, group, ""); } static void yahoo_add_buddies(struct gaim_connection *gc, GList *buddies) { @@ -465,22 +465,22 @@ } static void gyahoo_remove_buddy(struct gaim_connection *gc, char *name) { - /* struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; - struct yahoo_buddy *tmpbuddy; + struct yahoo_group *tmpgroup; struct group *g = find_group_by_buddy(gc, name); char *group = NULL; if (g) { group = g->name; - } else if (yd->ctxt && yd->ctxt->buddies[0]) { - tmpbuddy = yd->ctxt->buddies[0]; - group = tmpbuddy->group; + } else if (yd->sess && yd->sess->groups) { + tmpgroup = yd->sess->groups->data; + group = tmpgroup->name; + } else { + group = "Buddies"; } if (group) - yahoo_remove_buddy(yd->ctxt, name, yd->active_id, group, ""); - */ + yahoo_remove_buddy(yd->sess, yd->active_id, name, group, ""); } static char **yahoo_list_icon(int uc) {