changeset 21768:6b42bed44324

Do not allow ISON requests to stack in IRC
author Ethan Blanton <elb@pidgin.im>
date Tue, 04 Dec 2007 20:27:06 +0000
parents 8c1bcaaaac34
children 6fe5e9e85979
files libpurple/protocols/irc/irc.c libpurple/protocols/irc/irc.h libpurple/protocols/irc/msgs.c
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/irc/irc.c	Tue Dec 04 09:32:22 2007 +0000
+++ b/libpurple/protocols/irc/irc.c	Tue Dec 04 20:27:06 2007 +0000
@@ -184,9 +184,14 @@
 /* XXX I don't like messing directly with these buddies */
 gboolean irc_blist_timeout(struct irc_conn *irc)
 {
-	GString *string = g_string_sized_new(512);
+	GString *string;
 	char *list, *buf;
 
+	if (irc->ison_outstanding)
+		return TRUE;
+
+	string = g_string_sized_new(512);
+
 	g_hash_table_foreach(irc->buddies, (GHFunc)irc_buddy_append, (gpointer)string);
 
 	list = g_string_free(string, FALSE);
@@ -200,6 +205,8 @@
 	irc_send(irc, buf);
 	g_free(buf);
 
+	irc->ison_outstanding = TRUE;
+
 	return TRUE;
 }
 
--- a/libpurple/protocols/irc/irc.h	Tue Dec 04 09:32:22 2007 +0000
+++ b/libpurple/protocols/irc/irc.h	Tue Dec 04 20:27:06 2007 +0000
@@ -56,6 +56,8 @@
 	guint timer;
 	GHashTable *buddies;
 
+	gboolean ison_outstanding;
+
 	char *inbuf;
 	int inbuflen;
 	int inbufused;
--- a/libpurple/protocols/irc/msgs.c	Tue Dec 04 09:32:22 2007 +0000
+++ b/libpurple/protocols/irc/msgs.c	Tue Dec 04 20:27:06 2007 +0000
@@ -707,6 +707,7 @@
 	g_strfreev(nicks);
 
 	g_hash_table_foreach(irc->buddies, (GHFunc)irc_buddy_status, (gpointer)irc);
+	irc->ison_outstanding = FALSE;
 }
 
 static void irc_buddy_status(char *name, struct irc_buddy *ib, struct irc_conn *irc)