/pidgin/main: a4eb488f88ae: Remove redundant write_chat and writ...

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri May 23 03:44:13 EDT 2014


Changeset: a4eb488f88aeacb3b3e6f22fa2b85f3b549a1924
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-23 09:44 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/a4eb488f88ae

Description:

Remove redundant write_chat and write_im implementations

diffstat:

 finch/gntconv.c  |  43 ++-----------------------------------------
 pidgin/gtkconv.c |  28 +---------------------------
 2 files changed, 3 insertions(+), 68 deletions(-)

diffs (105 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -1090,45 +1090,6 @@ finch_write_common(PurpleConversation *c
 }
 
 static void
-finch_write_chat(PurpleChatConversation *chat, PurpleMessage *msg)
-{
-	purple_conversation_write(PURPLE_CONVERSATION(chat),
-		purple_message_get_author(msg),
-		purple_message_get_contents(msg),
-		purple_message_get_flags(msg),
-		purple_message_get_time(msg));
-}
-
-static void
-finch_write_im(PurpleIMConversation *im, PurpleMessage *msg)
-{
-	PurpleConversation *conv = PURPLE_CONVERSATION(im);
-	PurpleAccount *account = purple_conversation_get_account(conv);
-	PurpleMessageFlags flags = purple_message_get_flags(msg);
-	const gchar *who = purple_message_get_author(msg);
-
-	if (flags & PURPLE_MESSAGE_SEND)
-	{
-		who = purple_connection_get_display_name(purple_account_get_connection(account));
-		if (!who)
-			who = purple_account_get_private_alias(account);
-		if (!who)
-			who = purple_account_get_username(account);
-	}
-	else if (flags & PURPLE_MESSAGE_RECV)
-	{
-		PurpleBuddy *buddy;
-		who = purple_conversation_get_name(conv);
-		buddy = purple_blist_find_buddy(account, who);
-		if (buddy)
-			who = purple_buddy_get_contact_alias(buddy);
-	}
-
-	purple_conversation_write(conv, who, purple_message_get_contents(msg),
-		flags, purple_message_get_time(msg));
-}
-
-static void
 finch_write_conv(PurpleConversation *conv, const char *who, const char *alias,
 		const char *message, PurpleMessageFlags flags, time_t mtime)
 {
@@ -1266,8 +1227,8 @@ static PurpleConversationUiOps conv_ui_o
 {
 	finch_create_conversation,
 	finch_destroy_conversation,
-	finch_write_chat,
-	finch_write_im,
+	NULL, /* write_chat */
+	NULL, /* write_im */
 	finch_write_conv,
 	finch_chat_add_users,
 	finch_chat_rename_user,
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -6202,32 +6202,6 @@ pidgin_conv_destroy(PurpleConversation *
 	g_free(gtkconv);
 }
 
-
-static void
-pidgin_conv_write_im(PurpleIMConversation *im, PurpleMessage *msg)
-{
-	PidginConversation *gtkconv;
-	PurpleConversation *conv = PURPLE_CONVERSATION(im);
-	PurpleMessageFlags flags = purple_message_get_flags(msg);
-
-	gtkconv = PIDGIN_CONVERSATION(conv);
-
-	if (conv != gtkconv->active_conv &&
-	    flags & PURPLE_MESSAGE_ACTIVE_ONLY)
-	{
-		/* Plugins that want these messages suppressed should be
-		 * calling purple_im_conversation_write_message(), so they get suppressed here,
-		 * before being written to the log. */
-		purple_debug_info("gtkconv",
-		                "Suppressing message for an inactive conversation in pidgin_conv_write_im()\n");
-		return;
-	}
-
-	purple_conversation_write(conv, purple_message_get_author(msg),
-		purple_message_get_contents(msg), flags,
-		purple_message_get_time(msg));
-}
-
 #if 0
 static const char *
 get_text_tag_color(GtkTextTag *tag)
@@ -7745,7 +7719,7 @@ static PurpleConversationUiOps conversat
 	pidgin_conv_new,
 	pidgin_conv_destroy,              /* destroy_conversation */
 	NULL,                              /* write_chat           */
-	pidgin_conv_write_im,             /* write_im             */
+	NULL,                             /* write_im             */
 	pidgin_conv_write_conv,           /* write_conv           */
 	pidgin_conv_chat_add_users,       /* chat_add_users       */
 	pidgin_conv_chat_rename_user,     /* chat_rename_user     */



More information about the Commits mailing list