changeset 1557:1ca5f5fcd483

[gaim-migrate @ 1567] add/remove buddies works. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 10 Mar 2001 09:30:31 +0000
parents 22532a7e5fbf
children ab5dd2c7e7f8
files plugins/yay/buddy.c plugins/yay/internal.h plugins/yay/rxhandlers.c plugins/yay/yay.c
diffstat 4 files changed, 30 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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
--- 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);
 	}
 }
--- 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";
 	}