summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-14 21:11:15 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-14 21:11:15 (GMT)
commite10a0c0902b503bbffdc802aa238c8b6ac4fe210 (patch)
tree30b1ac8115d0e05d633dd2050bfb80d15d02f525
parent83bc9d0690697fdbbeab7c225a6cdb364ce59b46 (diff)
downloadswift-contrib-e10a0c0902b503bbffdc802aa238c8b6ac4fe210.zip
swift-contrib-e10a0c0902b503bbffdc802aa238c8b6ac4fe210.tar.bz2
Show the JID in the roster where there's no nick.
Resolves: #344
-rw-r--r--Swift/Controllers/RosterController.cpp6
1 files changed, 6 insertions, 0 deletions
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);