summary refs log tree commit diff
path: root/src/RoomList.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-10 01:34:53 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-10 01:34:53 +0300
commit87ecb28558347c01d2d4e23820f1f726937cfe1b (patch)
tree1bf514ac0440c8c92e3713a00d27783265f28ab7 /src/RoomList.cc
parentDisable travis notifications (diff)
downloadnheko-87ecb28558347c01d2d4e23820f1f726937cfe1b.tar.xz
Sanitize room info for display
Diffstat (limited to 'src/RoomList.cc')
-rw-r--r--src/RoomList.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/RoomList.cc b/src/RoomList.cc
index 4d0b9713..c56ea9b9 100644
--- a/src/RoomList.cc
+++ b/src/RoomList.cc
@@ -20,6 +20,7 @@
 #include <QDebug>
 #include <QJsonArray>
 #include <QLabel>
+#include <QRegularExpression>
 
 #include "RoomInfoListItem.h"
 #include "RoomList.h"
@@ -65,6 +66,10 @@ RoomInfo RoomList::extractRoomInfo(const State &room_state)
 		}
 	}
 
+	// Sanitize info for print.
+	info.setTopic(info.topic().replace(QRegularExpression("[\\s\\n\\r]+"), " "));
+	info.setName(info.name().replace(QRegularExpression("[\\s\\n\\r]+"), " "));
+
 	return info;
 }