Changeset - 62f3fbf99c88
[Not reviewed]
0 3 0
Jan Kaluza - 14 years ago 2011-04-06 14:32:03
hanzz.k@gmail.com
Buddy::JIDToLegacyName
3 files changed with 18 insertions and 2 deletions:
0 comments (0 inline, 0 general)
include/transport/buddy.h
Show inline comments
 
@@ -129,6 +129,8 @@ class Buddy {
 
		/// \return avatar hash or empty string.
 
		virtual std::string getIconHash() = 0;
 

	
 
		static std::string JIDToLegacyName(const Swift::JID &jid);
 

	
 
	private:
 
		void generateJID();
 

	
src/buddy.cpp
Show inline comments
 
@@ -153,4 +153,18 @@ void Buddy::buddyChanged() {
 
	}
 
}
 

	
 
std::string Buddy::JIDToLegacyName(const Swift::JID &jid) {
 
	std::string name;
 
	if (jid.getUnescapedNode() == jid.getNode()) {
 
		name = jid.getNode();
 
		if (name.find_last_of("%") != std::string::npos) {
 
			name.replace(name.find_last_of("%"), 1, "@");
 
		}
 
	}
 
	else {
 
		name = jid.getUnescapedNode();
 
	}
 
	return name;
 
}
 

	
 
}
src/rostermanager.cpp
Show inline comments
 
@@ -120,7 +120,7 @@ void RosterManager::sendRIE() {
 
}
 

	
 
void RosterManager::handleSubscription(Swift::Presence::ref presence) {
 
	></i>
 
	std::string legacyName = Buddy::JIDToLegacyName(presence->getTo());
 
}
 

	
 
}
 
\ No newline at end of file
 
}
0 comments (0 inline, 0 general)