diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-08-29 12:51:45 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-08-29 13:30:18 (GMT) |
commit | 0091fcc571758791442f82ece2a72444b6fe79cf (patch) | |
tree | 807f20a4047604a87f56d247d8ad7180489fe82b /Swiften/Elements | |
parent | 901f620b6ccabde19ef460368028fa0464aa56c5 (diff) | |
download | swift-0091fcc571758791442f82ece2a72444b6fe79cf.zip swift-0091fcc571758791442f82ece2a72444b6fe79cf.tar.bz2 |
Added Stanza Ack Requester & Responder.
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/Message.h | 4 | ||||
-rw-r--r-- | Swiften/Elements/Stanza.h | 1 | ||||
-rw-r--r-- | Swiften/Elements/StanzaAck.h | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h index f42aec6..e5e00ab 100644 --- a/Swiften/Elements/Message.h +++ b/Swiften/Elements/Message.h @@ -9,6 +9,7 @@ #include <boost/optional.hpp> #include "Swiften/Base/String.h" +#include "Swiften/Base/Shared.h" #include "Swiften/Elements/Body.h" #include "Swiften/Elements/Subject.h" #include "Swiften/Elements/ErrorPayload.h" @@ -16,8 +17,7 @@ namespace Swift { - class Message : public Stanza - { + class Message : public Stanza, public Shared<Message> { public: enum Type { Normal, Chat, Error, Groupchat, Headline }; diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h index 20fb557..5d8fd6c 100644 --- a/Swiften/Elements/Stanza.h +++ b/Swiften/Elements/Stanza.h @@ -14,6 +14,7 @@ #include "Swiften/Elements/Element.h" #include "Swiften/Elements/Payload.h" #include "Swiften/Base/String.h" +#include "Swiften/Base/Shared.h" #include "Swiften/Base/foreach.h" #include "Swiften/JID/JID.h" diff --git a/Swiften/Elements/StanzaAck.h b/Swiften/Elements/StanzaAck.h index a1a39f8..eaf4e26 100644 --- a/Swiften/Elements/StanzaAck.h +++ b/Swiften/Elements/StanzaAck.h @@ -12,21 +12,23 @@ namespace Swift { class StanzaAck : public Element, public Shared<StanzaAck> { public: - StanzaAck() : handledStanzasCount(-1) {} + StanzaAck() : valid(false), handledStanzasCount(0) {} - int getHandledStanzasCount() const { + unsigned int getHandledStanzasCount() const { return handledStanzasCount; } void setHandledStanzasCount(int i) { handledStanzasCount = i; + valid = true; } bool isValid() const { - return handledStanzasCount != -1; + return valid; } private: - int handledStanzasCount; + bool valid; + unsigned int handledStanzasCount; }; } |