/soc/2015/mmcc/main: ab3750dcd85e: Merge with release-2.x.y (wit...

Daniel Atallah datallah at pidgin.im
Tue Jun 23 16:02:34 EDT 2015


Changeset: ab3750dcd85e273c6f3e25d80cc28cca75557d3d
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2015-06-18 09:54 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/ab3750dcd85e

Description:

Merge with release-2.x.y (with some manual merge fixes, most notably in pidgin/plugins/notify.c)

diffstat:

 COPYRIGHT               |   1 +
 libpurple/proxy.c       |   3 +++
 libpurple/server.c      |   2 +-
 pidgin/plugins/notify.c |  48 ++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 51 insertions(+), 3 deletions(-)

diffs (117 lines):

diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -486,6 +486,7 @@ Carsten Schaar
 Toby Schaffer
 Jonathan Schleifer <js-pidgin at webkeks.org>
 Luke Schierer
+Sebastian Schmidt <yath at yath.de>
 Ralph Schmieder
 David Schmitt
 Heiko Schmitt
diff --git a/libpurple/proxy.c b/libpurple/proxy.c
--- a/libpurple/proxy.c
+++ b/libpurple/proxy.c
@@ -575,6 +575,9 @@ purple_win32_proxy_get_info(void)
 static void
 purple_proxy_connect_data_destroy(PurpleProxyConnectData *connect_data)
 {
+	if (!PURPLE_PROXY_CONNECT_DATA_IS_VALID(connect_data))
+		return;
+
 	handles = g_slist_remove(handles, connect_data);
 
 	if (connect_data->query_data != NULL)
diff --git a/libpurple/server.c b/libpurple/server.c
--- a/libpurple/server.c
+++ b/libpurple/server.c
@@ -767,7 +767,7 @@ PurpleChatConversation *purple_serv_got_
 
 	chat = purple_conversations_find_chat_with_account(name, account);
 	if (!chat) {
-	    chat = purple_chat_conversation_new(account, name);
+		chat = purple_chat_conversation_new(account, name);
 	}
 	g_return_val_if_fail(chat != NULL, NULL);
 
diff --git a/pidgin/plugins/notify.c b/pidgin/plugins/notify.c
--- a/pidgin/plugins/notify.c
+++ b/pidgin/plugins/notify.c
@@ -267,8 +267,29 @@ message_displayed_cb(PurpleConversation 
 	     !(flags & PURPLE_MESSAGE_NICK)))
 	    return FALSE;
 
-	if ((flags & PURPLE_MESSAGE_RECV) && !(flags & PURPLE_MESSAGE_DELAYED))
-		notify(conv, TRUE);
+	/* Ignore anything that's not a received message or a system message */
+	if (!(flags & (PURPLE_MESSAGE_RECV|PURPLE_MESSAGE_SYSTEM)))
+		return FALSE;
+	/* Don't highlight for delayed messages */
+	if ((flags & PURPLE_MESSAGE_RECV) && (flags & PURPLE_MESSAGE_DELAYED))
+		return FALSE;
+	/* Check whether to highlight for system message for either chat or IM */
+	if (flags & PURPLE_MESSAGE_SYSTEM) {
+		if (PURPLE_IS_CHAT_CONVERSATION(conv)) {
+			if (!purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_sys"))
+				return FALSE;
+		} else if (PURPLE_IS_IM_CONVERSATION(conv)) {
+			if (!purple_prefs_get_bool("/plugins/gtk/X11/notify/type_im_sys"))
+				return FALSE;
+			}
+		} else {
+			/* System message not from chat or IM, ignore */
+			return FALSE;
+		}
+	}
+
+	/* Nothing speaks against notifying, do so */
+	notify(conv, TRUE);
 
 	return FALSE;
 }
@@ -691,6 +712,17 @@ get_config_frame(PurplePlugin *plugin)
 	g_signal_connect(G_OBJECT(toggle), "toggled",
 	                 G_CALLBACK(type_toggle_cb), "type_im");
 
+	ref = toggle;
+	toggle = gtk_check_button_new_with_mnemonic(_("\t_Notify for System messages"));
+	gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
+	                            purple_prefs_get_bool("/plugins/gtk/X11/notify/type_im_sys"));
+	g_signal_connect(G_OBJECT(toggle), "toggled",
+	                 G_CALLBACK(type_toggle_cb), "type_im_sys");
+	gtk_widget_set_sensitive(toggle, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ref)));
+	g_signal_connect(G_OBJECT(ref), "toggled",
+	                 G_CALLBACK(pidgin_toggle_sensitive), toggle);
+
 	toggle = gtk_check_button_new_with_mnemonic(_("C_hat windows"));
 	gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
@@ -709,6 +741,16 @@ get_config_frame(PurplePlugin *plugin)
 	g_signal_connect(G_OBJECT(ref), "toggled",
 	                 G_CALLBACK(pidgin_toggle_sensitive), toggle);
 
+	toggle = gtk_check_button_new_with_mnemonic(_("\tNotify for _System messages"));
+	gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
+	                            purple_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_sys"));
+	g_signal_connect(G_OBJECT(toggle), "toggled",
+	                 G_CALLBACK(type_toggle_cb), "type_chat_sys");
+	gtk_widget_set_sensitive(toggle, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ref)));
+	g_signal_connect(G_OBJECT(ref), "toggled",
+	                 G_CALLBACK(pidgin_toggle_sensitive), toggle);
+
 	toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows"));
 	gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
@@ -876,8 +918,10 @@ plugin_load(PurplePlugin *plugin, GError
 	purple_prefs_add_none("/plugins/gtk/X11/notify");
 
 	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE);
+	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_im_sys", FALSE);
 	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE);
 	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_chat_nick", FALSE);
+	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_chat_sys", FALSE);
 	purple_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE);
 	purple_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE);
 	purple_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)");



More information about the Commits mailing list