/pidgin/main: f09daa9fd0fb: Add "buddy-removed-from-group" blist...

Florian Qu?ze florian at instantbird.org
Wed May 25 12:11:18 EDT 2016


Changeset: f09daa9fd0fbcec69687809ba9d879b88f41caf1
Author:	 Florian Qu?ze <florian at instantbird.org>
Date:	 2016-05-15 17:59 -0300
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/f09daa9fd0fb

Description:

Add "buddy-removed-from-group" blist signal from instantbird

It is fired when a buddy is removed permanently from a group but
not from the buddy list. (ie when the buddy has been moved)

diffstat:

 libpurple/buddylist.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (26 lines):

diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -994,8 +994,10 @@ void purple_blist_add_buddy(PurpleBuddy 
 		purple_counting_node_change_total_size(contact_counter, -1);
 		/* the group totalsize will be taken care of by remove_contact below */
 
-		if (bnode->parent->parent != (PurpleBlistNode*)g)
+		if (bnode->parent->parent != (PurpleBlistNode*)g) {
+			purple_signal_emit(purple_blist_get_handle(), "buddy-removed-from-group", buddy);
 			purple_serv_move_buddy(buddy, (PurpleGroup *)bnode->parent->parent, g);
+		}
 
 		if (bnode->next)
 			bnode->next->prev = bnode->prev;
@@ -1972,6 +1974,10 @@ purple_blist_init(void)
 						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
 						 PURPLE_TYPE_BLIST_NODE);
 
+	purple_signal_register(handle, "buddy-removed-from-group",
+						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+						 PURPLE_TYPE_BUDDY);
+
 	purple_signal_register(handle, "buddy-icon-changed",
 						 purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
 						 PURPLE_TYPE_BUDDY);



More information about the Commits mailing list