summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-11-22 07:51:50 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-11-30 10:29:11 (GMT)
commitc65a90e2a73814d09ad8c60adc4a259e90006db7 (patch)
treec6b0f90fba9aa2c64e94e35e99c9b30557d5e4ad /Swiften
parent2039930eadd4756068a8a60c8340d9908a7136d3 (diff)
downloadswift-c65a90e2a73814d09ad8c60adc4a259e90006db7.zip
swift-c65a90e2a73814d09ad8c60adc4a259e90006db7.tar.bz2
Show MUC PM item-not-found error in MUC PM window
Previously, if one would send a MUC PM to a user that has left a room the error response from the MUC would be shown in the MUC room. Now the error will show in the MUC PM window, if the MUC PM full JID has a ChatController. Test-Information: Added unit test verifying new behaviour. Manually verified that the error is shown in the MUC PM window instead of the MUC room window. Change-Id: I1b259d5eee9e22217bbe7e5c09294d2166a77895
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Elements/Message.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h
index f276ef7..c357cd4 100644
--- a/Swiften/Elements/Message.h
+++ b/Swiften/Elements/Message.h
@@ -39,10 +39,8 @@ namespace Swift {
updatePayload(std::make_shared<Subject>(subject));
}
- // Explicitly convert to bool. In C++11, it would be cleaner to
- // compare to nullptr.
bool hasSubject() {
- return static_cast<bool>(getPayload<Subject>());
+ return getPayload<Subject>() != nullptr;
}
boost::optional<std::string> getBody() const {