From 72c2e69c3126c5baeaf983d74c2a18a0b07a409f Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Fri, 23 Jul 2010 16:51:40 +0100
Subject: Don't create Notices for MUC history on join.


diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index 650a915..92ff7a9 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -18,6 +18,7 @@
 #include "Swift/Controllers/UIEvents/UIEventStream.h"
 #include "Swift/Controllers/UIEvents/RequestChatUIEvent.h"
 #include "Swiften/Avatars/AvatarManager.h"
+#include "Swiften/Elements/Delay.h"
 #include "Swiften/MUC/MUC.h"
 #include "Swiften/Client/StanzaChannel.h"
 #include "Swiften/Roster/Roster.h"
@@ -203,7 +204,7 @@ bool MUCController::messageTargetsMe(boost::shared_ptr<Message> message) {
 
 void MUCController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) {
 	boost::shared_ptr<Message> message = messageEvent->getStanza();
-	if (joined_ && messageTargetsMe(message)) {
+	if (joined_ && messageTargetsMe(message) && !message->getPayload<Delay>()) {
 		eventController_->handleIncomingEvent(messageEvent);
 	}
 	String nick = message->getFrom().getResource();
-- 
cgit v0.10.2-6-g49f6