summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Planas <roger.planas@isode.com>2018-11-16 11:04:27 (GMT)
committerRoger Planas <roger.planas@isode.com>2018-11-27 14:31:21 (GMT)
commit24ddcdb0a82cbd33deb5b72ad9f86f1c46fc9d13 (patch)
tree50dd6f7d520100e576b8824e137bf3246affd990 /Sluift/SluiftClient.h
parent560b5642eeeee9135e8995c04f99613387a7bfa8 (diff)
downloadswift-24ddcdb0a82cbd33deb5b72ad9f86f1c46fc9d13.zip
swift-24ddcdb0a82cbd33deb5b72ad9f86f1c46fc9d13.tar.bz2
Sluift: Added handling of roster push event
Swiften handles roster push event notifications, but those were not passed to Sluift, so a Sluift client, when querying events, would not be aware if an XMPP server roster pushes. This patch adds extra events types to Sluift so that method for_each_event reports roster pushes notifications. Test-information: Used sluift client to retrieve all items after adding, removing and updating roster items, and now Sluift clients can see these events. Change-Id: Ide5597bf2b39e3cc20014c66ba9153c551eec670
Diffstat (limited to 'Sluift/SluiftClient.h')
-rw-r--r--Sluift/SluiftClient.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h
index 39ff0a8..ac4c582 100644
--- a/Sluift/SluiftClient.h
+++ b/Sluift/SluiftClient.h
@@ -45,7 +45,10 @@ namespace Swift {
45 PresenceType, 45 PresenceType,
46 PubSubEventType, 46 PubSubEventType,
47 BlockEventType, 47 BlockEventType,
48 UnblockEventType 48 UnblockEventType,
49 RosterAddType,
50 RosterRemoveType,
51 RosterUpdateType
49 }; 52 };
50 53
51 Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {} 54 Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {}
@@ -61,7 +64,7 @@ namespace Swift {
61 JID from; 64 JID from;
62 std::shared_ptr<PubSubEventPayload> pubsubEvent; 65 std::shared_ptr<PubSubEventPayload> pubsubEvent;
63 66
64 // Blocklist 67 // Blocklist & Roster Push
65 JID item; 68 JID item;
66 }; 69 };
67 70
@@ -122,6 +125,9 @@ namespace Swift {
122 void handleIncomingBlockEvent(const JID& item); 125 void handleIncomingBlockEvent(const JID& item);
123 void handleIncomingUnblockEvent(const JID& item); 126 void handleIncomingUnblockEvent(const JID& item);
124 void handleInitialRosterPopulated(); 127 void handleInitialRosterPopulated();
128 void handleIncomingRosterAdd(const JID& item);
129 void handleIncomingRosterRemove(const JID& item);
130 void handleIncomingRosterUpdate(const JID& item);
125 void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error); 131 void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error);
126 void handleDisconnected(const boost::optional<ClientError>& error); 132 void handleDisconnected(const boost::optional<ClientError>& error);
127 133