diff options
Diffstat (limited to 'Sluift/SluiftClient.h')
| -rw-r--r-- | Sluift/SluiftClient.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h index a48c681..ac4c582 100644 --- a/Sluift/SluiftClient.h +++ b/Sluift/SluiftClient.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2013-2017 Isode Limited. + * Copyright (c) 2013-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once @@ -43,11 +43,14 @@ namespace Swift { 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) {} @@ -59,11 +62,11 @@ namespace Swift { // PubSubEvent JID from; std::shared_ptr<PubSubEventPayload> pubsubEvent; - // Blocklist + // Blocklist & Roster Push JID item; }; SluiftClient( const JID& jid, @@ -79,11 +82,10 @@ namespace Swift { ClientOptions& getOptions() { return options; } void connect(); - void connect(const std::string& host, int port); void waitConnected(int timeout); bool isConnected() const; void setTraceEnabled(bool b); template<typename T> @@ -108,11 +110,11 @@ namespace Swift { } void disconnect(); void setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os); boost::optional<SluiftClient::Event> getNextEvent(int timeout, - boost::function<bool (const Event&)> condition = 0); + boost::function<bool (const Event&)> condition = boost::function<bool (const Event&)>()); std::vector<XMPPRosterItem> getRoster(int timeout); std::vector<JID> getBlockList(int timeout); private: Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout); @@ -121,10 +123,13 @@ namespace Swift { 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; |
Swift