# HG changeset patch # User Eric Warmenhoven # Date 984216631 0 # Node ID 1ca5f5fcd483b638fd186fe28347badca88cd9a7 # Parent 22532a7e5fbfc640f0d9bb04f06c0eedac3cd7c6 [gaim-migrate @ 1567] add/remove buddies works. committer: Tailor Script diff -r 22532a7e5fbf -r 1ca5f5fcd483 plugins/yay/buddy.c --- a/plugins/yay/buddy.c Sat Mar 10 05:05:53 2001 +0000 +++ b/plugins/yay/buddy.c Sat Mar 10 09:30:31 2001 +0000 @@ -70,6 +70,8 @@ g_free(bdy); g_free(id); g_free(usr); + if (message && strlen(message)) + g_free(msg); if (!send) return 0; @@ -131,6 +133,8 @@ g_free(bdy); g_free(id); g_free(usr); + if (message && strlen(message)) + g_free(msg); if (!send) return 0; diff -r 22532a7e5fbf -r 1ca5f5fcd483 plugins/yay/internal.h --- a/plugins/yay/internal.h Sat Mar 10 05:05:53 2001 +0000 +++ b/plugins/yay/internal.h Sat Mar 10 09:30:31 2001 +0000 @@ -61,6 +61,7 @@ #define YAHOO_SERVICE_IDDEACT 8 #define YAHOO_SERVICE_NEWMAIL 11 #define YAHOO_SERVICE_NEWPERSONALMAIL 14 +#define YAHOO_SERVICE_NEWCONTACT 15 #define YAHOO_SERVICE_PING 18 #define YAHOO_MESSAGE_NORMAL 1 diff -r 22532a7e5fbf -r 1ca5f5fcd483 plugins/yay/rxhandlers.c --- a/plugins/yay/rxhandlers.c Sat Mar 10 05:05:53 2001 +0000 +++ b/plugins/yay/rxhandlers.c Sat Mar 10 09:30:31 2001 +0000 @@ -190,6 +190,7 @@ case YAHOO_SERVICE_LOGOFF: case YAHOO_SERVICE_ISAWAY: case YAHOO_SERVICE_ISBACK: + case YAHOO_SERVICE_NEWCONTACT: yahoo_parse_status(sess, pkt); break; case YAHOO_SERVICE_IDACT: @@ -297,7 +298,15 @@ } yahoo_parse_packet(session, conn, &pkt); } else if (conn->type == YAHOO_CONN_TYPE_DUMB) { - YAHOO_PRINT(session, YAHOO_LOG_DEBUG, "closing buddy list host connnection"); + char *buf = g_malloc0(5000); + while (read(socket, &buf[pos++], 1) == 1); + if (pos == 1) { + g_free(buf); + YAHOO_PRINT(session, YAHOO_LOG_WARNING, "error reading from listserv"); + return; + } + YAHOO_PRINT(session, YAHOO_LOG_DEBUG, buf); + YAHOO_PRINT(session, YAHOO_LOG_NOTICE, "closing buddy list host connnection"); yahoo_close(session, conn); } } diff -r 22532a7e5fbf -r 1ca5f5fcd483 plugins/yay/yay.c --- a/plugins/yay/yay.c Sat Mar 10 05:05:53 2001 +0000 +++ b/plugins/yay/yay.c Sat Mar 10 09:30:31 2001 +0000 @@ -472,15 +472,27 @@ static void gyahoo_remove_buddy(struct gaim_connection *gc, char *name) { struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; - 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->groups) { - tmpgroup = yd->sess->groups->data; - group = tmpgroup->name; + GList *x = yd->sess->groups; + while (x) { + struct yahoo_group *tmpgroup = x->data; + char **bds = tmpgroup->buddies; + while (*bds) { + if (!strcmp(*bds, name)) + break; + bds++; + } + if (*bds) { + group = tmpgroup->name; + break; + } + x = x->next; + } } else { group = "Buddies"; }