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/QtUI
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/QtUI')
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/QtUI/EventViewer/QtEvent.cpp b/Swift/QtUI/EventViewer/QtEvent.cpp
index 4d90bd9..4830aec 100644
--- a/Swift/QtUI/EventViewer/QtEvent.cpp
+++ b/Swift/QtUI/EventViewer/QtEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -64,7 +64,7 @@ QString QtEvent::sender() {
QString QtEvent::text() {
boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event_);
if (messageEvent) {
- return P2QSTRING(messageEvent->getStanza()->getBody());
+ return P2QSTRING(messageEvent->getStanza()->getBody().get_value_or(""));
}
boost::shared_ptr<SubscriptionRequestEvent> subscriptionRequestEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event_);
if (subscriptionRequestEvent) {