diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/ClientState.h | 31 | ||||
-rw-r--r-- | Swiften/Elements/DiscoInfo.cpp | 1 | ||||
-rw-r--r-- | Swiften/Elements/DiscoInfo.h | 1 |
3 files changed, 33 insertions, 0 deletions
diff --git a/Swiften/Elements/ClientState.h b/Swiften/Elements/ClientState.h new file mode 100644 index 0000000..868d352 --- /dev/null +++ b/Swiften/Elements/ClientState.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017 Tarun Gupta. + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <string> + +#include <Swiften/Base/API.h> +#include <Swiften/Elements/Payload.h> + +namespace Swift { + class SWIFTEN_API ClientState : public Payload { + public: + typedef std::shared_ptr<ClientState> ref; + + public: + enum class ClientStateType {Active, Inactive}; + ClientState(ClientStateType state = ClientStateType::Active) : state_(state) { + + } + + ClientStateType getClientState() const { return state_; } + void setClientState(ClientStateType state) {state_ = state;} + + private: + ClientStateType state_; + }; +} diff --git a/Swiften/Elements/DiscoInfo.cpp b/Swiften/Elements/DiscoInfo.cpp index 51a4450..11f0623 100644 --- a/Swiften/Elements/DiscoInfo.cpp +++ b/Swiften/Elements/DiscoInfo.cpp @@ -11,6 +11,7 @@ namespace Swift { const std::string DiscoInfo::ChatStatesFeature = std::string("http://jabber.org/protocol/chatstates"); +const std::string DiscoInfo::ClientStatesFeature = std::string("urn:xmpp:csi:0"); const std::string DiscoInfo::SecurityLabelsFeature = std::string("urn:xmpp:sec-label:0"); const std::string DiscoInfo::SecurityLabelsCatalogFeature = std::string("urn:xmpp:sec-label:catalog:2"); const std::string DiscoInfo::JabberSearchFeature = std::string("jabber:iq:search"); diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h index ebc598c..c8009ee 100644 --- a/Swiften/Elements/DiscoInfo.h +++ b/Swiften/Elements/DiscoInfo.h @@ -22,6 +22,7 @@ namespace Swift { typedef std::shared_ptr<DiscoInfo> ref; static const std::string ChatStatesFeature; + static const std::string ClientStatesFeature; static const std::string SecurityLabelsFeature; static const std::string SecurityLabelsCatalogFeature; static const std::string JabberSearchFeature; |