1 #include "irisprotocol/iris_discoinfoquerier.h"
2 #include "xmpp_discoinfotask.h"
3 
4 using namespace XMPP;
5 
6 namespace IrisProtocol {
7 
DiscoInfoQuerier(XMPP::Client * client)8 DiscoInfoQuerier::DiscoInfoQuerier(XMPP::Client* client) : client_(client)
9 {
10 }
11 
getDiscoInfo(const XMPP::Jid & jid,const QString & node)12 void DiscoInfoQuerier::getDiscoInfo(const XMPP::Jid& jid, const QString& node)
13 {
14 	JT_DiscoInfo* disco = new JT_DiscoInfo(client_->rootTask());
15 	connect(disco, SIGNAL(finished()), SLOT(discoFinished()));
16 	disco->get(jid, node);
17 	disco->go(true);
18 }
19 
discoFinished()20 void DiscoInfoQuerier::discoFinished()
21 {
22 	JT_DiscoInfo *disco = (JT_DiscoInfo*)sender();
23 	Q_ASSERT(disco);
24 	if (disco->success()) {
25 		emit getDiscoInfo_success(disco->jid(), disco->node(), disco->item());
26 	}
27 	else {
28 		emit getDiscoInfo_error(disco->jid(), disco->node(), disco->statusCode(), disco->statusString());
29 	}
30 }
31 
32 } // namespace
33 
34