From 7f4d4ffc8c656c5125fc3a53e5afdd4a8c5ff4f3 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sun, 31 Mar 2013 16:52:06 +0100 Subject: Don't display errors sent to the bare JID. Work around ejabberd bug where PEP publish errors get routed back to the client. Change-Id: I83c546ffabc4978fd9fa223fd15524988b7a19c8 Resolves: #1181 diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 39ec8c3..b60162f 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -211,8 +211,10 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr m std::string body = message->getBody(); HighlightAction highlight; if (message->isError()) { - std::string errorMessage = str(format(QT_TRANSLATE_NOOP("", "Couldn't send message: %1%")) % getErrorMessage(message->getPayload())); - chatWindow_->addErrorMessage(errorMessage); + if (!message->getTo().getResource().empty()) { + std::string errorMessage = str(format(QT_TRANSLATE_NOOP("", "Couldn't send message: %1%")) % getErrorMessage(message->getPayload())); + chatWindow_->addErrorMessage(errorMessage); + } } else if (messageEvent->getStanza()->getPayload()) { handleMUCInvitation(messageEvent->getStanza()); -- cgit v0.10.2-6-g49f6