diff options
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; }; } |