diff options
author | Vlad Voicu <vladvoic@gmail.com> | 2011-04-29 18:13:05 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-04-30 08:35:40 (GMT) |
commit | 09f61b624e99f69a9221ba46c15efa61892f475f (patch) | |
tree | 636be7dd1399a4cf97fda4343d6f849d9eac2e34 /Swiften/Parser/PayloadParsers/ReplaceParser.cpp | |
parent | d4781a09b22013da45adf8e9e8b6484fd672a3ec (diff) | |
download | swift-contrib-09f61b624e99f69a9221ba46c15efa61892f475f.zip swift-contrib-09f61b624e99f69a9221ba46c15efa61892f475f.tar.bz2 |
Correct message feature using XEP-Correct
Uses Kev's not-yet-published protocol for correcting the last sent message.
Release-Notes: You can now correct your previously sent message in a chat by pressing 'up' in the input field.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swiften/Parser/PayloadParsers/ReplaceParser.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/ReplaceParser.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/ReplaceParser.cpp b/Swiften/Parser/PayloadParsers/ReplaceParser.cpp new file mode 100644 index 0000000..8e5659f --- /dev/null +++ b/Swiften/Parser/PayloadParsers/ReplaceParser.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011 Vlad Voicu + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include "Swiften/Parser/PayloadParsers/ReplaceParser.h" + +namespace Swift { + + ReplaceParser::ReplaceParser() : level_(0) { + } + + void ReplaceParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) { + if (level_ == 0) { + std::string id = attributes.getAttribute("id"); + getPayloadInternal()->setId(id); + } + level_++; + } + + void ReplaceParser::handleEndElement(const std::string&, const std::string&) { + --level_; + } + + void ReplaceParser::handleCharacterData(const std::string&) { + } + +} |