cpw.darkrain42.irc: ab0701cb: Sort only by op statuses (not typing or ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon Jul 13 00:15:59 EDT 2009


-----------------------------------------------------------------
Revision: ab0701cb7b693759b1163133f4bb0681cca85436
Ancestor: da41b68bcb95dd662b20005cf9c31e03ecf2d7eb
Author: darkrain42 at pidgin.im
Date: 2009-07-13T00:56:29
Branch: im.pidgin.cpw.darkrain42.irc
URL: http://d.pidgin.im/viewmtn/revision/info/ab0701cb7b693759b1163133f4bb0681cca85436

Modified files:
        libpurple/util.c pidgin/gtkconv.c

ChangeLog: 

Sort only by op statuses (not typing or away).

Also clean up the flag usage (remove some unused variables).

-------------- next part --------------
============================================================
--- libpurple/util.c	a245ad53a854b490fc9055f290ea197553d77db9
+++ libpurple/util.c	6a29b0b68bac75d7f1edbf0b75a3f74ac921543f
@@ -1480,7 +1480,7 @@ struct purple_parse_tag {
 							c = strchr(c, '>') + 1; \
 							continue; \
 						}
-#define ALLOW_TAG(x) ALLOW_TAG_ALT(x, x)
+#define ALLOW_TAG(x) do { ALLOW_TAG_ALT(x, x) } while (0);
 void
 purple_markup_html_to_xhtml(const char *html, char **xhtml_out,
 						  char **plain_out)
============================================================
--- pidgin/gtkconv.c	bb9ecbfee6d3ab808fe9eb9bb0ccb0a5de0447f2
+++ pidgin/gtkconv.c	28d35f032be8f91b290d808b0b8805530a08f490
@@ -3990,12 +3990,12 @@ add_chat_buddy_common(PurpleConversation
 	gboolean is_me = FALSE;
 	gboolean is_buddy;
 	gchar *tmp, *alias_key, *name, *alias;
-	int flags;
+	PurpleConvChatBuddyFlags flags;
 	GdkColor *color = NULL;
 
 	alias = cb->alias;
 	name  = cb->name;
-	flags = GPOINTER_TO_INT(cb->flags);
+	flags = cb->flags;
 
 	chat    = PURPLE_CONV_CHAT(conv);
 	gtkconv = PIDGIN_CONVERSATION(conv);
@@ -4334,6 +4334,12 @@ sort_chat_users(GtkTreeModel *model, Gtk
 	                   CHAT_USERS_WEIGHT_COLUMN, &buddy2,
 	                   -1);
 
+	/* Only sort by membership levels */
+	f1 &= PURPLE_CBFLAGS_VOICE | PURPLE_CBFLAGS_HALFOP | PURPLE_CBFLAGS_OP |
+			PURPLE_CBFLAGS_FOUNDER;
+	f2 &= PURPLE_CBFLAGS_VOICE | PURPLE_CBFLAGS_HALFOP | PURPLE_CBFLAGS_OP |
+			PURPLE_CBFLAGS_FOUNDER;
+
 	if (user1 == NULL || user2 == NULL) {
 		if (!(user1 == NULL && user2 == NULL))
 			ret = (user1 == NULL) ? -1: 1;
@@ -6056,7 +6062,6 @@ pidgin_conv_chat_rename_user(PurpleConve
 	PurpleConvChat *chat;
 	PidginConversation *gtkconv;
 	PidginChatPane *gtkchat;
-	PurpleConvChatBuddyFlags flags;
 	PurpleConvChatBuddy *cbuddy;
 	GtkTreeIter iter;
 	GtkTreeModel *model;
@@ -6075,7 +6080,7 @@ pidgin_conv_chat_rename_user(PurpleConve
 	while (f != 0) {
 		char *val;
 
-		gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &val, CHAT_USERS_FLAGS_COLUMN, &flags, -1);
+		gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &val, -1);
 
 		if (!purple_utf8_strcasecmp(old_name, val)) {
 			gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
@@ -6166,7 +6171,6 @@ pidgin_conv_chat_update_user(PurpleConve
 pidgin_conv_chat_update_user(PurpleConversation *conv, const char *user)
 {
 	PurpleConvChat *chat;
-	PurpleConvChatBuddyFlags flags;
 	PurpleConvChatBuddy *cbuddy;
 	PidginConversation *gtkconv;
 	PidginChatPane *gtkchat;
@@ -6209,8 +6213,6 @@ pidgin_conv_chat_update_user(PurpleConve
 
 	g_return_if_fail(alias != NULL);
 
-	flags = purple_conv_chat_user_get_flags(chat, user);
-
 	cbuddy = purple_conv_chat_cb_find(chat, user);
 	if (cbuddy)
 		add_chat_buddy_common(conv, cbuddy, NULL);


More information about the Commits mailing list