From 00200cfc0df5b616eb2eb48e5bb252f970808d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 3 Jun 2011 16:03:37 +0200 Subject: Make StreamResume(d) element use unsigned int for stanza count. diff --git a/Swiften/Elements/StreamResume.h b/Swiften/Elements/StreamResume.h index 652182a..aec0909 100644 --- a/Swiften/Elements/StreamResume.h +++ b/Swiften/Elements/StreamResume.h @@ -25,16 +25,16 @@ namespace Swift { return resumeID; } - const boost::optional getHandledStanzasCount() const { + const boost::optional getHandledStanzasCount() const { return handledStanzasCount; } - void setHandledStanzasCount(int i) { + void setHandledStanzasCount(unsigned int i) { handledStanzasCount = i; } private: std::string resumeID; - boost::optional handledStanzasCount; + boost::optional handledStanzasCount; }; } diff --git a/Swiften/Elements/StreamResumed.h b/Swiften/Elements/StreamResumed.h index cc42895..cf9a755 100644 --- a/Swiften/Elements/StreamResumed.h +++ b/Swiften/Elements/StreamResumed.h @@ -25,16 +25,16 @@ namespace Swift { return resumeID; } - const boost::optional getHandledStanzasCount() const { + const boost::optional getHandledStanzasCount() const { return handledStanzasCount; } - void setHandledStanzasCount(int i) { + void setHandledStanzasCount(unsigned int i) { handledStanzasCount = i; } private: std::string resumeID; - boost::optional handledStanzasCount; + boost::optional handledStanzasCount; }; } diff --git a/Swiften/Parser/StreamResumeParser.cpp b/Swiften/Parser/StreamResumeParser.cpp index f54dcf0..cb1a61d 100644 --- a/Swiften/Parser/StreamResumeParser.cpp +++ b/Swiften/Parser/StreamResumeParser.cpp @@ -21,7 +21,7 @@ void StreamResumeParser::handleStartElement(const std::string&, const std::strin boost::optional handledStanzasCount = attributes.getAttributeValue("h"); if (handledStanzasCount) { try { - getElementGeneric()->setHandledStanzasCount(boost::lexical_cast(*handledStanzasCount)); + getElementGeneric()->setHandledStanzasCount(boost::lexical_cast(*handledStanzasCount)); } catch (const boost::bad_lexical_cast &) { } -- cgit v0.10.2-6-g49f6