From da5e31ec60d089c3ffbafc3246608c95ba44df06 Mon Sep 17 00:00:00 2001
From: Richard Maudsley <richard.maudsley@isode.com>
Date: Mon, 24 Feb 2014 09:22:24 +0000
Subject: Label fax numbers as fax and omit resources from JIDs in roster
 tooltips

Change-Id: I3101077446df6d673be594b0479dac169fb02f2b

diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp
index fde4c97..e0651bc 100644
--- a/Swift/Controllers/Roster/ContactRosterItem.cpp
+++ b/Swift/Controllers/Roster/ContactRosterItem.cpp
@@ -18,7 +18,7 @@ namespace Swift {
 
 
 ContactRosterItem::ContactRosterItem(const JID& jid, const JID& displayJID, const std::string& name, GroupRosterItem* parent)
-: RosterItem(name, parent), jid_(jid), displayJID_(displayJID), mucRole_(MUCOccupant::NoRole), mucAffiliation_(MUCOccupant::NoAffiliation), blockState_(BlockingNotSupported)
+: RosterItem(name, parent), jid_(jid), displayJID_(displayJID.toBare()), mucRole_(MUCOccupant::NoRole), mucAffiliation_(MUCOccupant::NoAffiliation), blockState_(BlockingNotSupported)
 {
 }
 
diff --git a/Swift/QtUI/Roster/RosterTooltip.cpp b/Swift/QtUI/Roster/RosterTooltip.cpp
index 045a955..86f175d 100644
--- a/Swift/QtUI/Roster/RosterTooltip.cpp
+++ b/Swift/QtUI/Roster/RosterTooltip.cpp
@@ -114,7 +114,8 @@ QString RosterTooltip::buildVCardSummary(VCard::ref vcard) {
 	// star | name | content
 	QString currentBlock;
 	foreach (const VCard::Telephone& tel, vcard->getTelephones()) {
-		QString field = buildVCardField(tel.isPreferred, QObject::tr("Telephone"), htmlEscape(P2QSTRING(tel.number)));
+		QString type = tel.isFax ? QObject::tr("Fax") : QObject::tr("Telephone");
+		QString field = buildVCardField(tel.isPreferred, type, htmlEscape(P2QSTRING(tel.number)));
 		if (tel.isPreferred) {
 			currentBlock = field;
 			break;
-- 
cgit v0.10.2-6-g49f6