changeset 24499:168329be9623

Prevent the Buddy State Notification plugin from duplicating notices when the same buddy is in multiple groups. Fixes #7609. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Florian Quèze <florian@instantbird.org>
date Mon, 24 Nov 2008 00:34:37 +0000
parents 7d07bb66f70b
children 8bfa0fb61498
files libpurple/plugins/statenotify.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/statenotify.c	Mon Nov 24 00:01:27 2008 +0000
+++ b/libpurple/plugins/statenotify.c	Mon Nov 24 00:34:37 2008 +0000
@@ -32,13 +32,18 @@
 		return;
 	g_return_if_fail(conv->type == PURPLE_CONV_TYPE_IM);
 
+	/* Prevent duplicate notifications for buddies which are multiple times
+	   in the buddy list */
+	if (buddy != purple_find_buddy(buddy->account, buddy->name))
+		return;
+
 	who = purple_buddy_get_alias(buddy);
 	escaped = g_markup_escape_text(who, -1);
 
 	g_snprintf(buf, sizeof(buf), message, escaped);
 	g_free(escaped);
 
-	purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY, time(NULL));
+	purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));
 }
 
 static void