From f9befc2e57772f4b4cfd7896ecd5322c17c778d3 Mon Sep 17 00:00:00 2001
From: c4pp4
Date: Thu, 14 Feb 2019 22:57:50 +0100
Subject: [PATCH 2/2] Fix Unity Messaging Menu

Make possible to close conversation window opened by Unity Messaging
Menu (debian/patches/messaging_menu.patch).

Bug-Ubuntu: https://launchpad.net/bugs/1339405
Signed-off-by: c4pp4
---
 src/pidgin-libnotify.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/pidgin-libnotify.c b/src/pidgin-libnotify.c
index 71c5872..bb45dcc 100644
--- a/src/pidgin-libnotify.c
+++ b/src/pidgin-libnotify.c
@@ -1235,21 +1235,12 @@ messaging_source_activated_cb (MessagingMenuApp *app,
 							   gpointer          user_data)
 {
 	PurpleConversation *conv;
-	PidginConversation *gtkconv;
 	purple_debug_info (PLUGIN_ID, "SOURCE activated '%s'\n", source_id);
 	/* find conversation with given source id */
 	conv = messaging_conversation_for_unique_id (source_id);
 
-	if (conv) {
-		gtkconv = PIDGIN_CONVERSATION (conv);
-		if (gtkconv == NULL) {
-			purple_debug_warning (PLUGIN_ID, "NULL gtkconv '%s'\n", source_id);
-			return;
-		}
-		pidgin_conv_switch_active_conversation(conv);
-		pidgin_conv_window_switch_gtkconv(gtkconv->win, gtkconv);
-		gtk_window_present(GTK_WINDOW(gtkconv->win->window));
-	}
+	g_return_if_fail(conv != NULL);
+	pidgin_conv_present_conversation(conv);
 }
 
 static gboolean
-- 
2.19.2

