diff plugins/signals-test.c @ 11454:201617d49573

[gaim-migrate @ 13693] This commit includes a number of changes: 1. Aliases are now used consistently in chats. If the prpl uses unique screen names for chats (e.g. Jabber), then aliases are not used at all. 2. The chat list is now colorized to match the colors used in the chat itself. 3. Buddies are bolded in the chat user list. 4. Buddies are sorted above non-buddies in the chat user list. 5. The chat user list is ellipsized when possible (i.e. on GTK+ 2.6.0 or above). 6. I've accepted patch #1178248, by Matt Amato to add "buddy-added" and "buddy-removed" signals. These were used in my implementation of #3 and #4, to update the GUI when users are added or removed from the buddy list. 7. I've added a "blist-node-aliased" signal that is emitted when a buddy, contact, or chat is aliased. 8. Since it was hard to separate and I need it at some point, I'm letting it slip in... I've changed GaimConversation.log to be a GList named logs. This way, we can have multiple logs for a single conversation. This will be necessary to implement unnamed chat logging in some reasonable fasion (see my notes in the TODO file). committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 06 Sep 2005 03:04:07 +0000
parents 920a37a4c1be
children 4d2d3104c92f
line wrap: on
line diff
--- a/plugins/signals-test.c	Tue Sep 06 02:35:26 2005 +0000
+++ b/plugins/signals-test.c	Tue Sep 06 03:04:07 2005 +0000
@@ -123,6 +123,39 @@
 }
 
 static void
+buddy_added_cb(GaimBuddy *buddy, void *data)
+{
+	gaim_debug_misc("signals test", "buddy_added_cb (%s)\n", gaim_buddy_get_name(buddy));
+}
+
+static void
+buddy_removed_cb(GaimBuddy *buddy, void *data)
+{
+	gaim_debug_misc("signals test", "buddy_removed_cb (%s)\n", gaim_buddy_get_name(buddy));
+}
+
+static void
+blist_node_aliased(GaimBlistNode *node, const char *old_alias)
+{
+	GaimContact *p = (GaimContact *)node;
+	GaimBuddy *b = (GaimBuddy *)node;
+	GaimChat *c = (GaimChat *)node;
+	GaimGroup *g = (GaimGroup *)node;
+
+	if (GAIM_BLIST_NODE_IS_CONTACT(node))
+		gaim_debug_misc("signals test", "blist-node-extended-menu (Contact: %s, %s)\n", p->alias, old_alias);
+	else if (GAIM_BLIST_NODE_IS_BUDDY(node))
+		gaim_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s, %s)\n", b->name, old_alias);
+	else if (GAIM_BLIST_NODE_IS_CHAT(node))
+		gaim_debug_misc("signals test", "blist-node-extended-menu (Chat: %s, %s)\n", c->alias, old_alias);
+	else if (GAIM_BLIST_NODE_IS_GROUP(node))
+		gaim_debug_misc("signals test", "blist-node-extended-menu (Group: %s, %s)\n", g->name, old_alias);
+	else
+		gaim_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d, %s)\n", node->type, old_alias);
+
+}
+
+static void
 blist_node_extended_menu_cb(GaimBlistNode *node, void *data)
 {
 	GaimContact *p = (GaimContact *)node;
@@ -564,6 +597,12 @@
 						plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL);
 	gaim_signal_connect(blist_handle, "buddy-signed-off",
 						plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL);
+	gaim_signal_connect(blist_handle, "buddy-added",
+						plugin, GAIM_CALLBACK(buddy_added_cb), NULL);
+	gaim_signal_connect(blist_handle, "blist-removed",
+						plugin, GAIM_CALLBACK(buddy_removed_cb), NULL);
+	gaim_signal_connect(blist_handle, "blist-node-aliased",
+						plugin, GAIM_CALLBACK(blist_node_aliased), NULL);
 	gaim_signal_connect(blist_handle, "blist-node-extended-menu",
 						plugin, GAIM_CALLBACK(blist_node_extended_menu_cb), NULL);