comparison libpurple/plugins/statenotify.c @ 24444: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 0d0088b03745
children 5ad07a31388e
comparison
equal deleted inserted replaced
24443:7d07bb66f70b 24444:168329be9623
30 30
31 if (conv == NULL) 31 if (conv == NULL)
32 return; 32 return;
33 g_return_if_fail(conv->type == PURPLE_CONV_TYPE_IM); 33 g_return_if_fail(conv->type == PURPLE_CONV_TYPE_IM);
34 34
35 /* Prevent duplicate notifications for buddies which are multiple times
36 in the buddy list */
37 if (buddy != purple_find_buddy(buddy->account, buddy->name))
38 return;
39
35 who = purple_buddy_get_alias(buddy); 40 who = purple_buddy_get_alias(buddy);
36 escaped = g_markup_escape_text(who, -1); 41 escaped = g_markup_escape_text(who, -1);
37 42
38 g_snprintf(buf, sizeof(buf), message, escaped); 43 g_snprintf(buf, sizeof(buf), message, escaped);
39 g_free(escaped); 44 g_free(escaped);
40 45
41 purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY, time(NULL)); 46 purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));
42 } 47 }
43 48
44 static void 49 static void
45 buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *old_status, 50 buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *old_status,
46 PurpleStatus *status, void *data) 51 PurpleStatus *status, void *data)