From 2305f69ba32813e4e7aa255c3c310a88493a0c12 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Thu, 26 Apr 2012 15:55:42 +0100
Subject: Avoid adding messages to the Notices view for the currently selected
 tab.

Resolves: #934

diff --git a/Swift/Controllers/EventWindowController.cpp b/Swift/Controllers/EventWindowController.cpp
index 32b9c76..a6ba3c1 100644
--- a/Swift/Controllers/EventWindowController.cpp
+++ b/Swift/Controllers/EventWindowController.cpp
@@ -6,6 +6,7 @@
 
 #include <Swift/Controllers/EventWindowController.h>
 
+#include <Swift/Controllers/XMPPEvents/MessageEvent.h>
 #include <Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h>
 #include <boost/bind.hpp>
 
@@ -40,7 +41,7 @@ void EventWindowController::handleEventConcluded(boost::shared_ptr<StanzaEvent>
 	window_->removeEvent(event);
 	bool includeAsCompleted = true;
 	/* Because subscription requests get duplicated, don't add them back */
-	if (boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event)) {
+	if (boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event) || boost::dynamic_pointer_cast<MessageEvent>(event)) {
 		includeAsCompleted = false;
 	}
 	if (includeAsCompleted) {
-- 
cgit v0.10.2-6-g49f6