summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-06-27 17:53:07 (GMT)
committerCatalin Badea <catalin.badea392@gmail.com>2012-06-27 17:53:07 (GMT)
commit72819f0c95ad3fe264806d3a072fcbfab3131fcf (patch)
tree002cdb467597cfbe774b93f49400e3facd9efe43 /Swift/Controllers/Chat/ChatControllerBase.cpp
parent0998d6a8f138e0fd00245fc3c1efc8878fa7b888 (diff)
downloadswift-contrib-72819f0c95ad3fe264806d3a072fcbfab3131fcf.zip
swift-contrib-72819f0c95ad3fe264806d3a072fcbfab3131fcf.tar.bz2
Display conversations by using roster selection
Diffstat (limited to 'Swift/Controllers/Chat/ChatControllerBase.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp
index 302f793..97b574b 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -145,7 +145,9 @@ void ChatControllerBase::handleSendMessageRequest(const std::string &body, bool
onActivity(message->getBody());
// log message
- historyController_->addMessage(getBaseJID(), selfJID_, std::string("me"), body, now);
+ if (historyController_) {
+ historyController_->addMessage(getBaseJID(), selfJID_, std::string("me"), body, now);
+ }
}
void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog> catalog, ErrorPayload::ref error) {
@@ -252,7 +254,9 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> m
}
else {
lastMessagesUIID_[from] = addMessage(body, senderDisplayNameFromMessage(from), isIncomingMessageFromMe(message), label, std::string(avatarManager_->getAvatarPath(from).string()), timeStamp);
- historyController_->addMessage(getBaseJID(), from, senderDisplayNameFromMessage(from), body, timeStamp);
+ if (historyController_) {
+ historyController_->addMessage(getBaseJID(), from, senderDisplayNameFromMessage(from), body, timeStamp);
+ }
}
}
chatWindow_->show();