changeset 27858:6f27b4d8c1c3

gtkconv: Remove the close-timer when a new message comes in. Fixes #8512. This will happen if I "close" a conversation window (hide it), which starts the close-timer. A new IM then comes in, which is hidden because I have "Hide new IM conversations" set to Always (or When away) and then the timer triggers a few minutes later.
author Paul Aurich <paul@darkrain42.org>
date Fri, 07 Aug 2009 17:11:12 +0000
parents fdf1f64de3a0
children 30bde00f1909
files ChangeLog pidgin/gtkconv.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 07 04:29:55 2009 +0000
+++ b/ChangeLog	Fri Aug 07 17:11:12 2009 +0000
@@ -182,6 +182,9 @@
 	* Fix a crash when closing the New Mail dialog if an account with new
 	  mail was previously disconnected while the dialog was open.
 	* Fix incorrect unread message counts for the new mail notifications.
+	* Do not lose unread messages with a hidden conversation window when
+	  new IM conversations are hidden and "Close IMs immediately when the tab
+	  is closed" is unset.
 
 	Finch:
 	* The hardware cursor is updated correctly. This will be useful
--- a/pidgin/gtkconv.c	Fri Aug 07 04:29:55 2009 +0000
+++ b/pidgin/gtkconv.c	Fri Aug 07 17:11:12 2009 +0000
@@ -5437,6 +5437,7 @@
 {
 	PurpleConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops();
 	gboolean hide = FALSE;
+	guint timer;
 
 	/* create hidden conv if hide_new pref is always */
 	if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always") == 0)
@@ -5460,6 +5461,13 @@
 		purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender);
 		ui_ops->create_conversation = pidgin_conv_new;
 	}
+
+	/* Somebody wants to keep this conversation around, so don't time it out */
+	timer = GPOINTER_TO_INT(purple_conversation_get_data(conv, "close-timer"));
+	if (timer) {
+		purple_timeout_remove(timer);
+		purple_conversation_set_data(conv, "close-timer", GINT_TO_POINTER(0));
+	}
 }
 
 static void