diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-17 14:36:22 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-17 14:36:22 (GMT) |
commit | 7a14385acccd599438a274d421735a7d0c4bc9fa (patch) | |
tree | cfdb97325d00cd552fa03d80cc882aebaf3b5424 /Swiften/Parser/PayloadParsers | |
parent | 1f8e319e256ac15438d63080d11a860dfa16431c (diff) | |
download | swift-contrib-7a14385acccd599438a274d421735a7d0c4bc9fa.zip swift-contrib-7a14385acccd599438a274d421735a7d0c4bc9fa.tar.bz2 |
Added handling of items deletions
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
-rw-r--r-- | Swiften/Parser/PayloadParsers/WhiteboardParser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp index 7581115..ea00335 100644 --- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp +++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp @@ -14,6 +14,7 @@ #include <Swiften/Whiteboard/Elements/Color.h> #include <Swiften/Whiteboard/Operations/WhiteboardInsertOperation.h> #include <Swiften/Whiteboard/Operations/WhiteboardUpdateOperation.h> +#include <Swiften/Whiteboard/Operations/WhiteboardDeleteOperation.h> #include <boost/optional.hpp> #include <boost/smart_ptr/make_shared.hpp> #include <boost/lexical_cast.hpp> @@ -45,7 +46,17 @@ namespace Swift { } catch (boost::bad_lexical_cast&) { } operation = updateOp; + } else if (type == "delete") { + WhiteboardDeleteOperation::ref deleteOp = boost::make_shared<WhiteboardDeleteOperation>(); + try { + deleteOp->setID(attributes.getAttributeValue("id").get_value_or("")); + deleteOp->setParentID(attributes.getAttributeValue("parentid").get_value_or("")); + deleteOp->setPos(boost::lexical_cast<int>(attributes.getAttributeValue("pos").get_value_or("0"))); + } catch (boost::bad_lexical_cast&) { + } + operation = deleteOp; } + } else if (level_ == 2) { if (element == "line") { int x1 = 0; |