diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-08 13:37:12 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-08 13:37:12 (GMT) |
commit | 6e9fb4e4a3aeee8c40617a4dda6e5e0892ceebad (patch) | |
tree | fd2c0a48c6f5d033fe742790fb2e640d7e13ba91 /Swiften/Parser/PayloadParsers | |
parent | 13ededd86bfb5dc5115af69d79810122313273b5 (diff) | |
download | swift-contrib-6e9fb4e4a3aeee8c40617a4dda6e5e0892ceebad.zip swift-contrib-6e9fb4e4a3aeee8c40617a4dda6e5e0892ceebad.tar.bz2 |
Added handling of whiteboard session requests
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
-rw-r--r-- | Swiften/Parser/PayloadParsers/WhiteboardParser.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp index 77e5c2c..94b67e5 100644 --- a/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp +++ b/Swiften/Parser/PayloadParsers/WhiteboardParser.cpp @@ -10,12 +10,21 @@ namespace Swift { WhiteboardParser::WhiteboardParser() : level_(0) { } void WhiteboardParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { + if (level_ == 0) { + std::string type = attributes.getAttribute("type"); + if (type.empty()) { + getPayloadInternal()->setType(WhiteboardPayload::Data); + } + else if (type == "request") { + getPayloadInternal()->setType(WhiteboardPayload::SessionRequest); + } + } ++level_; } void WhiteboardParser::handleEndElement(const std::string& element, const std::string&) { --level_; - if(level_ == 0) { + if (level_ == 0) { getPayloadInternal()->setData(data_); } } |