diff options
-rw-r--r-- | Swift/Controllers/HistoryViewController.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp index de63e74..21eb9eb 100644 --- a/Swift/Controllers/HistoryViewController.cpp +++ b/Swift/Controllers/HistoryViewController.cpp @@ -170,7 +170,14 @@ void HistoryViewController::handleReturnPressed(const std::string& keyword) { for (ContactsMap::const_iterator contact = contacts_[type].begin(); contact != contacts_[type].end(); contact++) { const JID& jid = contact->first; - roster_->addContact(jid, jid, nickResolver_->jidToNick(jid), category[type], avatarManager_->getAvatarPath(jid).string()); + std::string nick; + if (type == HistoryMessage::PrivateMessage) { + nick = jid.toString(); + } + else { + nick = nickResolver_->jidToNick(jid); + } + roster_->addContact(jid, jid, nick, category[type], avatarManager_->getAvatarPath(jid).string()); Presence::ref presence = presenceOracle_->getHighestPriorityPresence(jid); |