diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-27 07:59:51 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-27 07:59:51 (GMT) |
commit | 0bdb45be4aa66dcc478d5f061096b1adbaa3ab2c (patch) | |
tree | bd9cbfea05d2edb45d59a0fe5ad43da95a705416 /Swift/Controllers/RosterController.cpp | |
parent | aeaa3ef7a62f2aba11df6e20262fd17cff0bf9e0 (diff) | |
download | swift-contrib-0bdb45be4aa66dcc478d5f061096b1adbaa3ab2c.zip swift-contrib-0bdb45be4aa66dcc478d5f061096b1adbaa3ab2c.tar.bz2 |
Show JIDs for users without nicks in the roster.
Resolves: #344
Diffstat (limited to 'Swift/Controllers/RosterController.cpp')
-rw-r--r-- | Swift/Controllers/RosterController.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp index d8897e9..191d5fb 100644 --- a/Swift/Controllers/RosterController.cpp +++ b/Swift/Controllers/RosterController.cpp @@ -101,10 +101,7 @@ void RosterController::handleChangeStatusRequest(StatusShow::Type show, const St void RosterController::handleOnJIDAdded(const JID& jid) { std::vector<String> groups = xmppRoster_->getGroupsForJID(jid); - String name = xmppRoster_->getNameForJID(jid); - if (name.isEmpty()) { - name = jid.toString(); - } + String name = nickResolver_->jidToNick(jid); if (!groups.empty()) { foreach(const String& group, groups) { roster_->addContact(jid, name, group); @@ -120,15 +117,12 @@ void RosterController::handleOnJIDRemoved(const JID& jid) { void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName, const std::vector<String> passedOldGroups) { if (oldName != xmppRoster_->getNameForJID(jid)) { - roster_->applyOnItems(SetName(xmppRoster_->getNameForJID(jid), jid)); + roster_->applyOnItems(SetName(nickResolver_->jidToNick(jid), jid)); return; } std::vector<String> groups = xmppRoster_->getGroupsForJID(jid); std::vector<String> oldGroups = passedOldGroups; - String name = xmppRoster_->getNameForJID(jid); - if (name.isEmpty()) { - name = jid.toString(); - } + String name = nickResolver_->jidToNick(jid); String contactsGroup = "Contacts"; if (oldGroups.empty()) { oldGroups.push_back(contactsGroup); |