diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-04-10 01:34:53 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-04-10 01:34:53 +0300 |
commit | 87ecb28558347c01d2d4e23820f1f726937cfe1b (patch) | |
tree | 1bf514ac0440c8c92e3713a00d27783265f28ab7 /src/RoomList.cc | |
parent | Disable travis notifications (diff) | |
download | nheko-87ecb28558347c01d2d4e23820f1f726937cfe1b.tar.xz |
Sanitize room info for display
Diffstat (limited to 'src/RoomList.cc')
-rw-r--r-- | src/RoomList.cc | 5 |
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; } |