summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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 388f2c4..ee3a027 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -148,7 +148,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) {
@@ -255,7 +257,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();