summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-07-30 16:02:19 (GMT)
committerCătălin Badea <catalin.badea392@gmail.com>2012-08-11 15:59:13 (GMT)
commit40cd350c6ecab5167fdfc2dc2260aa410946b7cf (patch)
tree197daa82a18d22a6dbfc48736ee8f7e536c8075c /Swift/Controllers
parent7c3617acb71dd6ed23d29c81313b5caa1461e59d (diff)
downloadswift-contrib-40cd350c6ecab5167fdfc2dc2260aa410946b7cf.zip
swift-contrib-40cd350c6ecab5167fdfc2dc2260aa410946b7cf.tar.bz2
Fix displayed nicks.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/HistoryViewController.cpp5
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) {