From 68d9f9aa02e227355e0fc032f922853b36143f4a Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Fri, 27 Apr 2012 00:09:25 +0200
Subject: Mark corrected MUC messages as read on active chat.

Resolves: #943

License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php

diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 57f7c15..ed134aa 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -670,6 +670,10 @@ void QtChatWindow::replaceMessage(const std::string& message, const std::string&
 
 void QtChatWindow::replaceMessage(const std::string& message, const std::string& id, const boost::posix_time::ptime& time, const QString& style) {
 	if (!id.empty()) {
+		if (isWidgetSelected()) {
+			onAllMessagesRead();
+		}
+
 		QString messageHTML(Qt::escape(P2QSTRING(message)));
 		messageHTML = P2QSTRING(Linkify::linkify(Q2PSTRING(messageHTML)));
 		messageHTML.replace("\n","<br/>");
-- 
cgit v0.10.2-6-g49f6