summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/CoreClient.cpp26
-rw-r--r--Swiften/Client/CoreClient.h3
2 files changed, 23 insertions, 6 deletions
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index b2bbad8..7b1f3fd 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -24,9 +24,9 @@ namespace Swift {
CoreClient::CoreClient(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password) : jid_(jid), password_(password), eventLoop(eventLoop), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) {
stanzaChannel_ = new ClientSessionStanzaChannel();
- stanzaChannel_->onMessageReceived.connect(boost::ref(onMessageReceived));
- stanzaChannel_->onPresenceReceived.connect(boost::ref(onPresenceReceived));
- stanzaChannel_->onStanzaAcked.connect(boost::ref(onStanzaAcked));
+ stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreClient::handleMessageReceived, this, _1));
+ stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreClient::handlePresenceReceived, this, _1));
+ stanzaChannel_->onStanzaAcked.connect(boost::bind(&CoreClient::handleStanzaAcked, this, _1));
stanzaChannel_->onAvailableChanged.connect(boost::bind(&CoreClient::handleStanzaChannelAvailableChanged, this, _1));
iqRouter_ = new IQRouter(stanzaChannel_);
@@ -41,9 +41,9 @@ CoreClient::~CoreClient() {
delete iqRouter_;
stanzaChannel_->onAvailableChanged.disconnect(boost::bind(&CoreClient::handleStanzaChannelAvailableChanged, this, _1));
- stanzaChannel_->onMessageReceived.disconnect(boost::ref(onMessageReceived));
- stanzaChannel_->onPresenceReceived.disconnect(boost::ref(onPresenceReceived));
- stanzaChannel_->onStanzaAcked.disconnect(boost::ref(onStanzaAcked));
+ stanzaChannel_->onMessageReceived.disconnect(boost::bind(&CoreClient::handleMessageReceived, this, _1));
+ stanzaChannel_->onPresenceReceived.disconnect(boost::bind(&CoreClient::handlePresenceReceived, this, _1));
+ stanzaChannel_->onStanzaAcked.disconnect(boost::bind(&CoreClient::handleStanzaAcked, this, _1));
delete stanzaChannel_;
}
@@ -251,4 +251,18 @@ void CoreClient::setCertificateTrustChecker(CertificateTrustChecker* checker) {
certificateTrustChecker = checker;
}
+
+void CoreClient::handlePresenceReceived(Presence::ref presence) {
+ onPresenceReceived(presence);
+}
+
+void CoreClient::handleMessageReceived(Message::ref message) {
+ onMessageReceived(message);
+}
+
+void CoreClient::handleStanzaAcked(Stanza::ref stanza) {
+ onStanzaAcked(stanza);
+}
+
+
}
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 925a357..bac78a3 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -200,6 +200,9 @@ namespace Swift {
void handleNeedCredentials();
void handleDataRead(const String&);
void handleDataWritten(const String&);
+ void handlePresenceReceived(Presence::ref);
+ void handleMessageReceived(Message::ref);
+ void handleStanzaAcked(Stanza::ref);
private:
JID jid_;