# HG changeset patch # User Paul Aurich # Date 1249665072 0 # Node ID 6f27b4d8c1c304325f2cd76026dd501c946f6cc3 # Parent fdf1f64de3a01dee1903fbe55dba5a8afdfa19d7 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. diff -r fdf1f64de3a0 -r 6f27b4d8c1c3 ChangeLog --- 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 diff -r fdf1f64de3a0 -r 6f27b4d8c1c3 pidgin/gtkconv.c --- 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