Commit 61a5d2c3 authored by Georg's avatar Georg

removed some 'using namespaces'...

parent a3b63a73
......@@ -6,22 +6,22 @@
#include "EchoPayload.h"
using namespace boost;
// FIXME rewrite all binds to qt connects
EchoBot::EchoBot(NetworkFactories* networkFactories)
{
client = new Client("schorsch@jabber-germany.de", "jwillrein", networkFactories);
client = new Swift::Client("jid@jabber.lit", "pass", networkFactories);
client->setAlwaysTrustCertificates();
client->onConnected.connect(bind(&EchoBot::handleConnected, this));
client->onConnected.connect(boost::bind(&EchoBot::handleConnected, this));
client->onMessageReceived.connect(
bind(&EchoBot::handleMessageReceived, this, _1));
boost::bind(&EchoBot::handleMessageReceived, this, _1));
client->onPresenceReceived.connect(
bind(&EchoBot::handlePresenceReceived, this, _1));
tracer = new ClientXMLTracer(client);
boost::bind(&EchoBot::handlePresenceReceived, this, _1));
tracer = new Swift::ClientXMLTracer(client);
softwareVersionResponder = new SoftwareVersionResponder(client->getIQRouter());
softwareVersionResponder = new Swift::SoftwareVersionResponder(client->getIQRouter());
softwareVersionResponder->setVersion("EchoBot", "1.0");
softwareVersionResponder->start();
//...
......@@ -49,11 +49,11 @@ EchoBot::~EchoBot()
void EchoBot::handlePresenceReceived(Presence::ref presence)
{
// Automatically approve subscription requests
if (presence->getType() == Presence::Subscribe)
if (presence->getType() == Swift::Presence::Subscribe)
{
Presence::ref response = Presence::create();
Swift::Presence::ref response = Swift::Presence::create();
response->setTo(presence->getFrom());
response->setType(Presence::Subscribed);
response->setType(Swift::Presence::Subscribed);
client->sendPresence(response);
}
}
......@@ -61,8 +61,8 @@ void EchoBot::handlePresenceReceived(Presence::ref presence)
void EchoBot::handleConnected()
{
// Request the roster
GetRosterRequest::ref rosterRequest =
GetRosterRequest::create(client->getIQRouter());
Swift::GetRosterRequest::ref rosterRequest =
Swift::GetRosterRequest::create(client->getIQRouter());
rosterRequest->onResponse.connect(
bind(&EchoBot::handleRosterReceived, this, _2));
rosterRequest->send();
......
......@@ -2,30 +2,29 @@
#define ECHPBOT_H
#include <Swiften/Swiften.h>
#include <QObject>
#include "EchoPayloadParserFactory.h"
#include "EchoPayloadSerializer.h"
using namespace Swift;
using namespace boost;
class EchoBot
{
//Q_OBJECT
public:
EchoBot(NetworkFactories* networkFactories);
EchoBot(Swift::NetworkFactories* networkFactories);
~EchoBot();
private:
void handlePresenceReceived(Presence::ref presence);
private slots:
void handlePresenceReceived(Swift::Presence::ref presence);
void handleConnected();
void handleRosterReceived(ErrorPayload::ref error);
void handleMessageReceived(Message::ref message);
void handleRosterReceived(Swift::ErrorPayload::ref error);
void handleMessageReceived(Swift::Message::ref message);
Client* client;
ClientXMLTracer* tracer;
SoftwareVersionResponder* softwareVersionResponder;
private:
Swift::Client* client;
Swift::ClientXMLTracer* tracer;
Swift::SoftwareVersionResponder* softwareVersionResponder;
EchoPayloadParserFactory echoPayloadParserFactory;
EchoPayloadSerializer echoPayloadSerializer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment