summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Burgess <pete.burgess@isode.com>2018-03-27 12:30:56 (GMT)
committerPeter Burgess <pete.burgess@isode.com>2018-03-27 15:13:17 (GMT)
commitce001ffe0d598c75df5719b9a6aa0e544594408a (patch)
treef0ea942124313ac7c3f0d6301ff34ca8c4215f48 /Swift/Controllers/Chat/MUCController.cpp
parent098b96c9dd9e27bf2c1067221be334b1cc209f6b (diff)
downloadswift-ce001ffe0d598c75df5719b9a6aa0e544594408a.zip
swift-ce001ffe0d598c75df5719b9a6aa0e544594408a.tar.bz2
Fix empty marking colour handling in MUCController
When there is a room security marking and the colours have the value "" they should be set to the default black and white. Instead they were being set to "", so I have updated this and uncommented the relevant unit test. Test-Information: The uncommented unit test is now passing, and all other related unit tests still pass. A MUC room with a marking but blank colour values has been tested on a test server and works as expected. Change-Id: I1138ca1f035f8b7c0367c36ec3a65cc857721b8c
Diffstat (limited to 'Swift/Controllers/Chat/MUCController.cpp')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index 4c3f524..139f425 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -1285,10 +1285,10 @@ void MUCController::requestSecurityMarking() {
auto markingBackgroundColor = roomInfoForm->getField("x-isode#roominfo_marking_bg_color");
std::string markingForegroundColorValue = "Black";
std::string markingBackgroundColorValue = "White";
- if (markingForegroundColor) {
+ if (markingForegroundColor && markingForegroundColor->getTextSingleValue() != "") {
markingForegroundColorValue = markingForegroundColor->getTextSingleValue();
}
- if (markingBackgroundColor) {
+ if (markingBackgroundColor && markingBackgroundColor->getTextSingleValue() != "") {
markingBackgroundColorValue = markingBackgroundColor->getTextSingleValue();
}
setMUCSecurityMarking(markingValue, markingForegroundColorValue, markingBackgroundColorValue);