diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-07-30 16:02:19 (GMT) |
---|---|---|
committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-07-30 16:02:19 (GMT) |
commit | 2fe9c9f3952b5ab6b8a158233deda8a89fe0b589 (patch) | |
tree | 1981aa842b819b4d1aa67d117020ef4c23a4ba3b | |
parent | 6db3199e0e2133c08609b42732194b041cd532ad (diff) | |
download | swift-contrib-2fe9c9f3952b5ab6b8a158233deda8a89fe0b589.zip swift-contrib-2fe9c9f3952b5ab6b8a158233deda8a89fe0b589.tar.bz2 |
Fix displayed nicks.
-rw-r--r-- | Swift/Controllers/HistoryViewController.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp index 082be1b..57b331b 100644 --- a/Swift/Controllers/HistoryViewController.cpp +++ b/Swift/Controllers/HistoryViewController.cpp @@ -54,7 +54,6 @@ HistoryViewController::~HistoryViewController() { } void HistoryViewController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) { - // TODO: add new nick manager boost::shared_ptr<RequestHistoryUIEvent> event = boost::dynamic_pointer_cast<RequestHistoryUIEvent>(rawEvent); if (event != NULL) { if (historyWindow_ == NULL) { @@ -143,7 +142,9 @@ void HistoryViewController::handleNewMessage(const HistoryMessage& message) { void HistoryViewController::addNewMessage(const HistoryMessage& message, bool addAtTheTop) { bool senderIsSelf = message.getFromJID().toBare() == selfJID_; std::string avatarPath = avatarManager_->getAvatarPath(message.getFromJID()).string(); - historyWindow_->addMessage(message.getMessage(), nickResolver_->jidToNick(message.getFromJID()), senderIsSelf, avatarPath, message.getTime(), addAtTheTop); + + std::string nick = message.getType() != HistoryMessage::Groupchat ? nickResolver_->jidToNick(message.getFromJID()) : message.getFromJID().getResource(); + historyWindow_->addMessage(message.getMessage(), nick, senderIsSelf, avatarPath, message.getTime(), addAtTheTop); } void HistoryViewController::handleReturnPressed(const std::string& keyword) { |