Changeset - 2d49798d12ed
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-06-19 19:53:53
hanzz.k@gmail.com
Fixed VCard without to attribute
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vcardresponder.cpp
Show inline comments
 
@@ -56,6 +56,7 @@ void VCardResponder::sendVCard(unsigned int id, boost::shared_ptr<Swift::VCard>
 
bool VCardResponder::handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::VCard> payload) {
 
	// Get means we're in server mode and user wants to fetch his roster.
 
	// For now we send empty reponse, but TODO: Get buddies from database and send proper stored roster.
 
	std::cout << "VCARD\n";
 
	User *user = m_userManager->getUser(from.toBare().toString());
 
	if (!user) {
 
		return false;
 
@@ -66,13 +67,15 @@ bool VCardResponder::handleGetRequest(const Swift::JID& from, const Swift::JID&
 
	std::string name = to_.getUnescapedNode();
 
	if (name.empty()) {
 
		to_ = user->getComponent()->getJID();
 
		std::string name = to_.getUnescapedNode();
 
		name = to_.getUnescapedNode();
 
	}
 

	
 
	if (name.find_last_of("%") != std::string::npos) {
 
		name.replace(name.find_last_of("%"), 1, "@");
 
	}
 

	
 
	std::cout << "VCARD1 " << name << "\n";
 

	
 
	m_queries[m_id].from = from;
 
	m_queries[m_id].to = to_;
 
	m_queries[m_id].id = id; 
0 comments (0 inline, 0 general)