Пример #1
0
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, "@"); // OK
		}
	}
	else {
		name = jid.getUnescapedNode();
		// Psi sucks...
// 		if (name.find_last_of("\\40") != std::string::npos) {
// 			name.replace(name.find_last_of("\\40"), 1, "@"); // OK
// 		}
	}
	return name;
}
Пример #2
0
BuddyFlag Buddy::buddFlagsFromJID(const Swift::JID &jid) {
	if (jid.getUnescapedNode() == jid.getNode()) {
		return BUDDY_NO_FLAG;
	}
	return BUDDY_JID_ESCAPING;
}