/soc/2013/ankitkv/gobjectification: c1ebfa7d3a7a: Replaced chat_...

Ankit Vani a at nevitus.org
Sun Jun 23 09:07:00 EDT 2013


Changeset: c1ebfa7d3a7a7f24127c8538d761711de2b01e70
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-23 18:36 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/c1ebfa7d3a7a

Description:

Replaced chat_conversation_cb_ with chat_conversation_buddy_ calls, and _buddy_find to _find_buddy

diffstat:

 finch/gntconv.c                       |  20 +++++++++---------
 libpurple/protocols/null/nullprpl.c   |   2 +-
 libpurple/protocols/yahoo/yahoochat.c |   6 ++--
 pidgin/gtkconv.c                      |  36 +++++++++++++++++-----------------
 4 files changed, 32 insertions(+), 32 deletions(-)

diffs (220 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -1128,8 +1128,8 @@ finch_chat_add_users(PurpleConversation 
 			PurpleChatConversationBuddy *cbuddy = iter->data;
 			const char *str;
 
-			if ((str = purple_chat_conversation_cb_get_alias(cbuddy)) == NULL)
-				str = purple_chat_conversation_cb_get_name(cbuddy);
+			if ((str = purple_chat_conversation_buddy_get_alias(cbuddy)) == NULL)
+				str = purple_chat_conversation_buddy_get_name(cbuddy);
 			g_string_append_printf(string, "[ %s ]", str);
 		}
 
@@ -1142,10 +1142,10 @@ finch_chat_add_users(PurpleConversation 
 	{
 		PurpleChatConversationBuddy *cbuddy = users->data;
 		GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
-		gnt_entry_add_suggest(entry, purple_chat_conversation_cb_get_name(cbuddy));
-		gnt_entry_add_suggest(entry, purple_chat_conversation_cb_get_alias(cbuddy));
-		gnt_tree_add_row_after(tree, g_strdup(purple_chat_conversation_cb_get_name(cbuddy)),
-				gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_cb_get_flags(cbuddy)), purple_chat_conversation_cb_get_alias(cbuddy)), NULL, NULL);
+		gnt_entry_add_suggest(entry, purple_chat_conversation_buddy_get_name(cbuddy));
+		gnt_entry_add_suggest(entry, purple_chat_conversation_buddy_get_alias(cbuddy));
+		gnt_tree_add_row_after(tree, g_strdup(purple_chat_conversation_buddy_get_name(cbuddy)),
+				gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_buddy_get_flags(cbuddy)), purple_chat_conversation_buddy_get_alias(cbuddy)), NULL, NULL);
 	}
 }
 
@@ -1156,7 +1156,7 @@ finch_chat_rename_user(PurpleConversatio
 	FinchConv *ggc = FINCH_CONV(conv);
 	GntEntry *entry = GNT_ENTRY(ggc->entry);
 	GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
-	PurpleChatConversationBuddy *cb = purple_chat_conversation_cb_find(PURPLE_CONV_CHAT(conv), new_n);
+	PurpleChatConversationBuddy *cb = purple_chat_conversation_find_buddy(PURPLE_CONV_CHAT(conv), new_n);
 
 	gnt_entry_remove_suggest(entry, old);
 	gnt_tree_remove(tree, (gpointer)old);
@@ -1164,7 +1164,7 @@ finch_chat_rename_user(PurpleConversatio
 	gnt_entry_add_suggest(entry, new_n);
 	gnt_entry_add_suggest(entry, new_a);
 	gnt_tree_add_row_after(tree, g_strdup(new_n),
-			gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_cb_get_flags(cb)), new_a), NULL, NULL);
+			gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_buddy_get_flags(cb)), new_a), NULL, NULL);
 }
 
 static void
@@ -1183,9 +1183,9 @@ finch_chat_remove_users(PurpleConversati
 static void
 finch_chat_update_user(PurpleConversation *conv, const char *user)
 {
-	PurpleChatConversationBuddy *cb = purple_chat_conversation_cb_find(PURPLE_CONV_CHAT(conv), user);
+	PurpleChatConversationBuddy *cb = purple_chat_conversation_find_buddy(PURPLE_CONV_CHAT(conv), user);
 	FinchConv *ggc = FINCH_CONV(conv);
-	gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(purple_chat_conversation_cb_get_flags(cb)));
+	gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(purple_chat_conversation_buddy_get_flags(cb)));
 }
 
 static void
diff --git a/libpurple/protocols/null/nullprpl.c b/libpurple/protocols/null/nullprpl.c
--- a/libpurple/protocols/null/nullprpl.c
+++ b/libpurple/protocols/null/nullprpl.c
@@ -794,7 +794,7 @@ static PurpleCmdRet send_whisper(PurpleC
                     from_username, to_username, purple_conversation_get_name(conv), message);
 
   chat = purple_conversation_get_chat_data(conv);
-  chat_buddy = purple_chat_conversation_cb_find(chat, to_username);
+  chat_buddy = purple_chat_conversation_find_buddy(chat, to_username);
   to = get_nullprpl_gc(to_username);
 
   if (!chat_buddy) {
diff --git a/libpurple/protocols/yahoo/yahoochat.c b/libpurple/protocols/yahoo/yahoochat.c
--- a/libpurple/protocols/yahoo/yahoochat.c
+++ b/libpurple/protocols/yahoo/yahoochat.c
@@ -770,7 +770,7 @@ void yahoo_conf_leave(YahooData *yd, con
 
 	yahoo_packet_hash_str(pkt, 1, dn);
 	for (w = who; w; w = w->next) {
-		const char *name = purple_chat_conversation_cb_get_name(w->data);
+		const char *name = purple_chat_conversation_buddy_get_name(w->data);
 		yahoo_packet_hash_str(pkt, 3, name);
 	}
 
@@ -794,7 +794,7 @@ static int yahoo_conf_send(PurpleConnect
 
 	yahoo_packet_hash_str(pkt, 1, dn);
 	for (who = members; who; who = who->next) {
-		const char *name = purple_chat_conversation_cb_get_name(who->data);
+		const char *name = purple_chat_conversation_buddy_get_name(who->data);
 		yahoo_packet_hash_str(pkt, 53, name);
 	}
 	yahoo_packet_hash(pkt, "ss", 57, room, 14, msg2);
@@ -852,7 +852,7 @@ static void yahoo_conf_invite(PurpleConn
 
 	yahoo_packet_hash(pkt, "sssss", 1, dn, 51, buddy, 57, room, 58, msg?msg2:"", 13, "0");
 	for(; members; members = members->next) {
-		const char *name = purple_chat_conversation_cb_get_name(members->data);
+		const char *name = purple_chat_conversation_buddy_get_name(members->data);
 		if (!strcmp(name, dn))
 			continue;
 		yahoo_packet_hash(pkt, "ss", 52, name, 53, name);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -4149,11 +4149,11 @@ get_chat_buddy_status_icon(PurpleChatCon
 static void
 deleting_chat_buddy_cb(PurpleChatConversationBuddy *cb)
 {
-	GtkTreeRowReference *ref = purple_chat_conversation_cb_get_ui_data(cb);
+	GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cb);
 
 	if (ref) {
 		gtk_tree_row_reference_free(ref);
-		purple_chat_conversation_cb_set_ui_data(cb, NULL);
+		purple_chat_conversation_buddy_set_ui_data(cb, NULL);
 	}
 }
 
@@ -4177,9 +4177,9 @@ add_chat_buddy_common(PurpleConversation
 	PurpleChatConversationBuddyFlags flags;
 	GdkColor *color = NULL;
 
-	alias = purple_chat_conversation_cb_get_alias(cb);
-	name  = purple_chat_conversation_cb_get_name(cb);
-	flags = purple_chat_conversation_cb_get_flags(cb);
+	alias = purple_chat_conversation_buddy_get_alias(cb);
+	name  = purple_chat_conversation_buddy_get_name(cb);
+	flags = purple_chat_conversation_buddy_get_flags(cb);
 
 	chat    = PURPLE_CONV_CHAT(conv);
 	gtkconv = PIDGIN_CONVERSATION(conv);
@@ -4197,7 +4197,7 @@ add_chat_buddy_common(PurpleConversation
 	if (!strcmp(purple_chat_conversation_get_nick(chat), purple_normalize(purple_conversation_get_account(conv), old_name != NULL ? old_name : name)))
 		is_me = TRUE;
 
-	is_buddy = purple_chat_conversation_cb_is_buddy(cb);
+	is_buddy = purple_chat_conversation_buddy_is_buddy(cb);
 
 	tmp = g_utf8_casefold(alias, -1);
 	alias_key = g_utf8_collate_key(tmp, -1);
@@ -4238,13 +4238,13 @@ add_chat_buddy_common(PurpleConversation
 			CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
 			-1);
 
-	if (purple_chat_conversation_cb_get_ui_data(cb)) {
-		GtkTreeRowReference *ref = purple_chat_conversation_cb_get_ui_data(cb);
+	if (purple_chat_conversation_buddy_get_ui_data(cb)) {
+		GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cb);
 		gtk_tree_row_reference_free(ref);
 	}
 
 	newpath = gtk_tree_model_get_path(tm, &iter);
-	purple_chat_conversation_cb_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath));
+	purple_chat_conversation_buddy_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath));
 	gtk_tree_path_free(newpath);
 
 	if (is_me && color)
@@ -4400,7 +4400,7 @@ tab_complete(PurpleConversation *conv)
 		/* Users */
 		for (; l != NULL; l = l->next) {
 			tab_complete_process_item(&most_matched, entered, entered_bytes, &partial, nick_partial,
-									  &matches, purple_chat_conversation_cb_get_name((PurpleChatConversationBuddy *)l->data));
+									  &matches, purple_chat_conversation_buddy_get_name((PurpleChatConversationBuddy *)l->data));
 		}
 
 
@@ -6793,7 +6793,7 @@ static gboolean get_iter_from_chatbuddy(
 
 	g_return_val_if_fail(cb != NULL, FALSE);
 
-	ref = purple_chat_conversation_cb_get_ui_data(cb);
+	ref = purple_chat_conversation_buddy_get_ui_data(cb);
 	if (!ref)
 		return FALSE;
 
@@ -6879,21 +6879,21 @@ pidgin_conv_chat_rename_user(PurpleConve
 	if ((tag = get_buddy_tag(conv, old_name, PURPLE_MESSAGE_NICK, FALSE)))
 		g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL);
 
-	old_cbuddy = purple_chat_conversation_cb_find(chat, old_name);
+	old_cbuddy = purple_chat_conversation_find_buddy(chat, old_name);
 	if (!old_cbuddy)
 		return;
 
 	if (get_iter_from_chatbuddy(old_cbuddy, &iter)) {
-		GtkTreeRowReference *ref = purple_chat_conversation_cb_get_ui_data(old_cbuddy);
+		GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(old_cbuddy);
 
 		gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
 		gtk_tree_row_reference_free(ref);
-		purple_chat_conversation_cb_set_ui_data(old_cbuddy, NULL);
+		purple_chat_conversation_buddy_set_ui_data(old_cbuddy, NULL);
 	}
 
 	g_return_if_fail(new_alias != NULL);
 
-	new_cbuddy = purple_chat_conversation_cb_find(chat, new_name);
+	new_cbuddy = purple_chat_conversation_find_buddy(chat, new_name);
 
 	add_chat_buddy_common(conv, new_cbuddy, old_name);
 }
@@ -6972,15 +6972,15 @@ pidgin_conv_chat_update_user(PurpleConve
 	if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
 		return;
 
-	cbuddy = purple_chat_conversation_cb_find(chat, user);
+	cbuddy = purple_chat_conversation_find_buddy(chat, user);
 	if (!cbuddy)
 		return;
 
 	if (get_iter_from_chatbuddy(cbuddy, &iter)) {
-		GtkTreeRowReference *ref = purple_chat_conversation_cb_get_ui_data(cbuddy);
+		GtkTreeRowReference *ref = purple_chat_conversation_buddy_get_ui_data(cbuddy);
 		gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
 		gtk_tree_row_reference_free(ref);
-		purple_chat_conversation_cb_set_ui_data(cbuddy, NULL);
+		purple_chat_conversation_buddy_set_ui_data(cbuddy, NULL);
 	}
 
 	if (cbuddy)



More information about the Commits mailing list