Changeset - 96425ce8dba1
[Not reviewed]
0 2 0
HanzZ - 14 years ago 2011-06-19 10:09:49
hanzz.k@gmail.com
Asnwer to VCards without to attribute
2 files changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
spectrum/src/sample.cfg
Show inline comments
 
@@ -11,8 +11,8 @@ backend_port=10001
 
users_per_backend=2
 
backend=../../backends/libpurple/spectrum_libpurple_backend
 
#backend=../../backends/libircclient-qt/spectrum_libircclient-qt_backend
 
protocol=prpl-jabber
 
#protocol=prpl-msn
 
#protocol=prpl-jabber
 
protocol=prpl-msn
 
#protocol=prpl-icq
 

	
 
[database]
src/vcardresponder.cpp
Show inline comments
 
@@ -27,6 +27,7 @@
 
#include "transport/user.h"
 
#include "transport/usermanager.h"
 
#include "transport/rostermanager.h"
 
#include "transport/transport.h"
 

	
 
using namespace Swift;
 
using namespace boost;
 
@@ -60,13 +61,20 @@ bool VCardResponder::handleGetRequest(const Swift::JID& from, const Swift::JID&
 
		return false;
 
	}
 

	
 
	std::string name = to.getUnescapedNode();
 
	Swift::JID to_ = to;
 

	
 
	std::string name = to_.getUnescapedNode();
 
	if (name.empty()) {
 
		to_ = user->getComponent()->getJID();
 
		std::string name = to_.getUnescapedNode();
 
	}
 

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

	
 
	m_queries[m_id].from = from;
 
	m_queries[m_id].to = to;
 
	m_queries[m_id].to = to_;
 
	m_queries[m_id].id = id; 
 
	onVCardRequired(user, name, m_id++);
 
	return true;
0 comments (0 inline, 0 general)