summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/SluiftClient.cpp')
-rw-r--r--Sluift/SluiftClient.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp
index 5243ed0..99892a9 100644
--- a/Sluift/SluiftClient.cpp
+++ b/Sluift/SluiftClient.cpp
@@ -38,6 +38,9 @@ SluiftClient::SluiftClient(
client->onPresenceReceived.connect(boost::bind(&SluiftClient::handleIncomingPresence, this, _1));
client->getPubSubManager()->onEvent.connect(boost::bind(&SluiftClient::handleIncomingPubSubEvent, this, _1, _2));
client->getRoster()->onInitialRosterPopulated.connect(boost::bind(&SluiftClient::handleInitialRosterPopulated, this));
+ client->getRoster()->onJIDAdded.connect(boost::bind(&SluiftClient::handleIncomingRosterAdd, this, _1));
+ client->getRoster()->onJIDRemoved.connect(boost::bind(&SluiftClient::handleIncomingRosterRemove, this, _1));
+ client->getRoster()->onJIDUpdated.connect(boost::bind(&SluiftClient::handleIncomingRosterUpdate, this, _1));
client->getClientBlockListManager()->getBlockList()->onItemAdded.connect(boost::bind(&SluiftClient::handleIncomingBlockEvent, this, _1));
client->getClientBlockListManager()->getBlockList()->onItemRemoved.connect(boost::bind(&SluiftClient::handleIncomingUnblockEvent, this, _1));
}
@@ -192,6 +195,18 @@ void SluiftClient::handleInitialRosterPopulated() {
rosterReceived = true;
}
+void SluiftClient::handleIncomingRosterAdd(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterAddType));
+}
+
+void SluiftClient::handleIncomingRosterRemove(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterRemoveType));
+}
+
+void SluiftClient::handleIncomingRosterUpdate(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterUpdateType));
+}
+
void SluiftClient::handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error) {
requestResponse = response;
requestError = error;