diff options
Diffstat (limited to 'Sluift/SluiftClient.h')
| -rw-r--r-- | Sluift/SluiftClient.h | 10 |
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 @@ -39,35 +39,38 @@ namespace Swift { class SluiftClient { public: struct Event { enum Type { MessageType, PresenceType, PubSubEventType, BlockEventType, - UnblockEventType + UnblockEventType, + RosterAddType, + RosterRemoveType, + RosterUpdateType }; Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {} Event(std::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {} Event(const JID& from, std::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {} Event(const JID& item, Type type) : type(type), item(item) {} Type type; // Message & Presence std::shared_ptr<Stanza> stanza; // PubSubEvent JID from; std::shared_ptr<PubSubEventPayload> pubsubEvent; - // Blocklist + // Blocklist & Roster Push JID item; }; SluiftClient( const JID& jid, const std::string& password, NetworkFactories* networkFactories, SimpleEventLoop* eventLoop); ~SluiftClient(); @@ -116,18 +119,21 @@ namespace Swift { private: Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout); void handleIncomingMessage(std::shared_ptr<Message> stanza); void handleIncomingPresence(std::shared_ptr<Presence> stanza); void handleIncomingPubSubEvent(const JID& from, std::shared_ptr<PubSubEventPayload> event); void handleIncomingBlockEvent(const JID& item); void handleIncomingUnblockEvent(const JID& item); void handleInitialRosterPopulated(); + void handleIncomingRosterAdd(const JID& item); + void handleIncomingRosterRemove(const JID& item); + void handleIncomingRosterUpdate(const JID& item); void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error); void handleDisconnected(const boost::optional<ClientError>& error); private: NetworkFactories* networkFactories; SimpleEventLoop* eventLoop; Client* client; ClientOptions options; ClientXMLTracer* tracer; |
Swift