changeset 4416:8e62cee6d738

[gaim-migrate @ 4689] The "Invalid Parameter" message is no longer given when logging onto IRC without any IRC buddies on your list. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 26 Jan 2003 01:39:46 +0000
parents c90039137172
children fff9c1292fa1
files src/protocols/irc/irc.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Sun Jan 26 01:22:02 2003 +0000
+++ b/src/protocols/irc/irc.c	Sun Jan 26 01:39:46 2003 +0000
@@ -633,6 +633,7 @@
 	struct irc_data *id = gc->proto_data;
 	char buf[500];
 	int n = g_snprintf(buf, sizeof(buf), "ISON");
+	gboolean found = FALSE;
 
 	GSList *gr = groups;
 	if (!gr || id->bc)
@@ -651,14 +652,20 @@
 					n = g_snprintf(buf, sizeof(buf), "ISON");
 				}
 				n += g_snprintf(buf + n, sizeof(buf) - n, " %s", b->name);
+
+				found = TRUE;
 			}
 			m = m->next;
 		}
 		gr = gr->next;
 	}
-	g_snprintf(buf + n, sizeof(buf) - n, "\r\n");
-	irc_write(id->fd, buf, strlen(buf));
-	id->bc++;
+
+	if (found) {
+		g_snprintf(buf + n, sizeof(buf) - n, "\r\n");
+		irc_write(id->fd, buf, strlen(buf));
+		id->bc++;
+	}
+
 	return TRUE;
 }