From e10a0c0902b503bbffdc802aa238c8b6ac4fe210 Mon Sep 17 00:00:00 2001 From: Kevin Smith <git@kismith.co.uk> Date: Fri, 14 May 2010 21:11:15 +0000 Subject: Show the JID in the roster where there's no nick. Resolves: #344 diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp index 4738d76..d8897e9 100644 --- a/Swift/Controllers/RosterController.cpp +++ b/Swift/Controllers/RosterController.cpp @@ -102,6 +102,9 @@ 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(); + } if (!groups.empty()) { foreach(const String& group, groups) { roster_->addContact(jid, name, group); @@ -123,6 +126,9 @@ void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName, std::vector<String> groups = xmppRoster_->getGroupsForJID(jid); std::vector<String> oldGroups = passedOldGroups; String name = xmppRoster_->getNameForJID(jid); + if (name.isEmpty()) { + name = jid.toString(); + } String contactsGroup = "Contacts"; if (oldGroups.empty()) { oldGroups.push_back(contactsGroup); -- cgit v0.10.2-6-g49f6