/pidgin/main: dd2cec2beaf6: Don't log system messages, that appe...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sat Feb 2 14:32:04 EST 2013


Changeset: dd2cec2beaf633134777f1fd9c9795005d26d700
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-02-02 20:31 +0100
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/dd2cec2beaf6

Description:

Don't log system messages, that appear on *every* MUC entry/exit

diffstat:

 finch/gntconv.c                      |  2 +-
 libpurple/protocols/jabber/message.c |  8 +++++---
 pidgin/gtkconv.c                     |  2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diffs (67 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -383,7 +383,7 @@ account_signing_off(PurpleConnection *gc
 			purple_conversation_write(conv, NULL, _("The account has disconnected and you are no "
 						"longer in this chat. You will be automatically rejoined in the chat when "
 						"the account reconnects."),
-					PURPLE_MESSAGE_SYSTEM, time(NULL));
+					PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, time(NULL));
 		}
 		list = list->next;
 	}
diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c
--- a/libpurple/protocols/jabber/message.c
+++ b/libpurple/protocols/jabber/message.c
@@ -219,6 +219,7 @@ static void handle_groupchat(JabberMessa
 {
 	JabberID *jid = jabber_id_new(jm->from);
 	JabberChat *chat;
+	PurpleMessageFlags messageFlags = 0;
 
 	if(!jid)
 		return;
@@ -231,6 +232,7 @@ static void handle_groupchat(JabberMessa
 	if(jm->subject) {
 		purple_conv_chat_set_topic(PURPLE_CONV_CHAT(chat->conv), jid->resource,
 				jm->subject);
+		messageFlags |= PURPLE_MESSAGE_NO_LOG;
 		if(!jm->xhtml && !jm->body) {
 			char *msg, *tmp, *tmp2;
 			tmp = g_markup_escape_text(jm->subject, -1);
@@ -239,7 +241,7 @@ static void handle_groupchat(JabberMessa
 				msg = g_strdup_printf(_("%s has set the topic to: %s"), jid->resource, tmp2);
 			else
 				msg = g_strdup_printf(_("The topic is: %s"), tmp2);
-			purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "", msg, PURPLE_MESSAGE_SYSTEM, jm->sent);
+			purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "", msg, messageFlags | PURPLE_MESSAGE_SYSTEM, jm->sent);
 			g_free(tmp);
 			g_free(tmp2);
 			g_free(msg);
@@ -249,12 +251,12 @@ static void handle_groupchat(JabberMessa
 	if(jm->xhtml || jm->body) {
 		if(jid->resource)
 			serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
-							jm->delayed ? PURPLE_MESSAGE_DELAYED : 0,
+							messageFlags | (jm->delayed ? PURPLE_MESSAGE_DELAYED : 0),
 							jm->xhtml ? jm->xhtml : jm->body, jm->sent);
 		else if(chat->muc)
 			purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "",
 							jm->xhtml ? jm->xhtml : jm->body,
-							PURPLE_MESSAGE_SYSTEM, jm->sent);
+							messageFlags | PURPLE_MESSAGE_SYSTEM, jm->sent);
 	}
 
 	jabber_id_free(jid);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -8195,7 +8195,7 @@ account_signing_off(PurpleConnection *gc
 			purple_conversation_write(conv, NULL, _("The account has disconnected and you are no "
 						"longer in this chat. You will automatically rejoin the chat when "
 						"the account reconnects."),
-					PURPLE_MESSAGE_SYSTEM, time(NULL));
+					PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, time(NULL));
 		}
 		list = list->next;
 	}



More information about the Commits mailing list