summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-01-12 17:23:05 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-02-02 11:33:06 (GMT)
commit1b9ccc1fef6104eaf951153ddccdc6bb15899e9a (patch)
tree428232448e9846265605820db6f380a5b98c018a /Swift/Controllers/XMPPEvents
parent3afd061b713ce5fff604dee62dec8410a1de6a9c (diff)
downloadswift-1b9ccc1fef6104eaf951153ddccdc6bb15899e9a.zip
swift-1b9ccc1fef6104eaf951153ddccdc6bb15899e9a.tar.bz2
Change stanza body to boost::optional<std::string> type
Changed MUCController to only handle message stanzas as subject change if <subject/> is present and neither <body/> nor <thread/> is present in the message stanza. Test-Information: Added unit tests verifying behavior described in XEP-0045 section 8.1. Unit tests pass on OS X 10.11.2. Change-Id: I1d22272da1675176be131ab360b214a98f20533f
Diffstat (limited to 'Swift/Controllers/XMPPEvents')
-rw-r--r--Swift/Controllers/XMPPEvents/MessageEvent.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Swift/Controllers/XMPPEvents/MessageEvent.h b/Swift/Controllers/XMPPEvents/MessageEvent.h
index be8b1b0..b5b1215 100644
--- a/Swift/Controllers/XMPPEvents/MessageEvent.h
+++ b/Swift/Controllers/XMPPEvents/MessageEvent.h
@@ -1,17 +1,19 @@
/*
- * Copyright (c) 2010-2012 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+
#include <cassert>
#include <boost/shared_ptr.hpp>
-#include <Swift/Controllers/XMPPEvents/StanzaEvent.h>
#include <Swiften/Elements/Message.h>
+#include <Swift/Controllers/XMPPEvents/StanzaEvent.h>
+
namespace Swift {
class MessageEvent : public StanzaEvent {
public:
@@ -22,7 +24,7 @@ namespace Swift {
boost::shared_ptr<Message> getStanza() {return stanza_;}
bool isReadable() {
- return getStanza()->isError() || !getStanza()->getBody().empty();
+ return getStanza()->isError() || !getStanza()->getBody().get_value_or("").empty();
}
void read() {