Changeset - 485d355ea84c
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-05-19 19:08:39
hanzz.k@gmail.com
PrivateStorage responder
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/discoinforesponder.cpp
Show inline comments
 
@@ -18,48 +18,49 @@
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#include "discoinforesponder.h"
 

	
 
#include <iostream>
 
#include <boost/bind.hpp>
 
#include "Swiften/Disco/DiscoInfoResponder.h"
 
#include "Swiften/Queries/IQRouter.h"
 
#include "Swiften/Elements/DiscoInfo.h"
 
#include "Swiften/Swiften.h"
 

	
 
using namespace Swift;
 
using namespace boost;
 

	
 
namespace Transport {
 

	
 
DiscoInfoResponder::DiscoInfoResponder(Swift::IQRouter *router) : Swift::GetResponder<DiscoInfo>(router) {
 
	m_transportInfo.addIdentity(DiscoInfo::Identity("libtransport", "gateway", "identity"));
 

	
 
	m_buddyInfo.addIdentity(DiscoInfo::Identity("libtransport", "client", "pc"));
 
	std::list<std::string> features;
 
	features.push_back("jabber:iq:register");
 
	features.push_back("jabber:iq:gateway");
 
	features.push_back("jabber:iq:private");
 
	features.push_back("http://jabber.org/protocol/disco#info");
 
	features.push_back("http://jabber.org/protocol/commands");
 
	setTransportFeatures(features);
 

	
 
	features.clear();
 
	features.push_back("http://jabber.org/protocol/disco#items");
 
	features.push_back("http://jabber.org/protocol/disco#info");
 
	setBuddyFeatures(features);
 
}
 

	
 
DiscoInfoResponder::~DiscoInfoResponder() {
 
	
 
}
 

	
 
void DiscoInfoResponder::setTransportFeatures(std::list<std::string> &features) {
 
	for (std::list<std::string>::iterator it = features.begin(); it != features.end(); it++) {
 
		if (!m_transportInfo.hasFeature(*it)) {
 
			m_transportInfo.addFeature(*it);
 
		}
 
	}
 
}
 

	
 
void DiscoInfoResponder::setBuddyFeatures(std::list<std::string> &f) {
 
	for (std::list<std::string>::iterator it = f.begin(); it != f.end(); it++) {
0 comments (0 inline, 0 general)