changeset 9238:f4f210e47b60

[gaim-migrate @ 10036] This is Tim's patch from 908047. I'm committing it now instead of letting him commit it so I can continue to feel relevant. If it breaks, tell Tim. If it doesn't, I'll take the credit. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 08 Jun 2004 05:34:51 +0000
parents fac583b4ecdf
children 3434d420fe69
files src/protocols/irc/irc.c src/protocols/irc/msgs.c
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Tue Jun 08 02:20:14 2004 +0000
+++ b/src/protocols/irc/irc.c	Tue Jun 08 05:34:51 2004 +0000
@@ -361,6 +361,8 @@
 	struct irc_buddy *ib = g_new0(struct irc_buddy, 1);
 	ib->name = g_strdup(who);
 	g_hash_table_insert(irc->buddies, ib->name, ib);
+
+	irc_blist_timeout(irc);
 }
 
 static void irc_remove_buddy(GaimConnection *gc, const char *who, const char *group)
--- a/src/protocols/irc/msgs.c	Tue Jun 08 02:20:14 2004 +0000
+++ b/src/protocols/irc/msgs.c	Tue Jun 08 05:34:51 2004 +0000
@@ -549,6 +549,7 @@
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
 	GaimConversation *convo;
 	char *nick = irc_mask_nick(from), *userhost;
+	struct irc_buddy *ib;
 	static int id = 1;
 
 	if (!gc) {
@@ -572,6 +573,12 @@
 
 	userhost = irc_mask_userhost(from);
 	gaim_conv_chat_add_user(GAIM_CONV_CHAT(convo), nick, userhost);
+
+	if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) {
+		ib->flag = TRUE;
+		irc_buddy_status(nick, ib, irc);
+	}
+
 	g_free(userhost);
 	g_free(nick);
 }
@@ -846,6 +853,7 @@
 void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
+	struct irc_buddy *ib;
 	char *data[2];
 
 	if (!args || !args[0] || !gc)
@@ -855,6 +863,11 @@
 	data[1] = args[0];
 	/* XXX this should have an API, I shouldn't grab this directly */
 	g_slist_foreach(gc->buddy_chats, (GFunc)irc_chat_remove_buddy, data);
+
+	if ((ib = g_hash_table_lookup(irc->buddies, data[0])) != NULL) {
+		ib->flag = FALSE;
+		irc_buddy_status(data[0], ib, irc);
+	}
 	g_free(data[0]);
 
 	return;