/soc/2013/ankitkv/gobjectification: 7fc063ef8da1: finch: Don't a...

Ankit Vani a at nevitus.org
Sun Nov 17 13:33:07 EST 2013


Changeset: 7fc063ef8da1f6519bcd9ca8ea4fb56cb44968cf
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-17 22:10 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/7fc063ef8da1

Description:

finch: Don't assume a conversation is always an IM or a chat

diffstat:

 finch/gntconv.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (48 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -97,7 +97,7 @@ get_conversation_blist_node(PurpleConver
 	if (PURPLE_IS_IM_CONVERSATION(conv)) {
 		node = (PurpleBlistNode*)find_buddy_for_conversation(conv);
 		node = node ? purple_blist_node_get_parent(node) : NULL;
-	} else {
+	} else if (PURPLE_IS_CHAT_CONVERSATION(conv)) {
 		node = (PurpleBlistNode*)find_chat_for_conversation(conv);
 	}
 
@@ -523,8 +523,10 @@ view_log_cb(GntMenuItem *n, gpointer ggc
 
 	if (PURPLE_IS_IM_CONVERSATION(conv))
 		type = PURPLE_LOG_IM;
+	else if (PURPLE_IS_CHAT_CONVERSATION(conv))
+		type = PURPLE_LOG_CHAT;
 	else
-		type = PURPLE_LOG_CHAT;
+		return;
 
 	name = purple_conversation_get_name(conv);
 	account = purple_conversation_get_account(conv);
@@ -658,7 +660,7 @@ gg_create_menu(FinchConv *ggc)
 		}
 
 		generate_send_to_menu(ggc);
-	} else {
+	} else if (PURPLE_IS_CHAT_CONVERSATION(ggc->active_conv)) {
 		item = gnt_menuitem_new(_("Invite..."));
 		gnt_menu_add_item(GNT_MENU(sub), item);
 		gnt_menuitem_set_callback(item, invite_cb, ggc);
@@ -810,8 +812,12 @@ finch_create_conversation(PurpleConversa
 	gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE);
 	gnt_box_set_pad(GNT_BOX(ggc->window), 0);
 
-	gnt_widget_set_name(ggc->window,
-			PURPLE_IS_IM_CONVERSATION(conv) ? "conversation-window-im" : "conversation-window-chat");
+	if (PURPLE_IS_IM_CONVERSATION(conv))
+		gnt_widget_set_name(ggc->window, "conversation-window-im");
+	else if (PURPLE_IS_CHAT_CONVERSATION(conv))
+		gnt_widget_set_name(ggc->window, "conversation-window-chat");
+	else
+		gnt_widget_set_name(ggc->window, "conversation-window-other");
 
 	ggc->tv = gnt_text_view_new();
 	gnt_widget_set_name(ggc->tv, "conversation-window-textview");



More information about the Commits mailing list