summaryrefslogtreecommitdiffstats
path: root/src/Utils.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-25 18:10:05 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-25 18:10:05 +0200
commit597f829c57adea24b4ff75260091b4a8f86f08c0 (patch)
tree25e396f305adf0bf0968f60eb7041f07fd7e62f2 /src/Utils.cc
parent67418e11b1275beda0e8d1f28ee7f19be47139e7 (diff)
Remove '#' from the room avatars
Diffstat (limited to 'src/Utils.cc')
-rw-r--r--src/Utils.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Utils.cc b/src/Utils.cc
index 9d575c09..01f0b67e 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -123,8 +123,13 @@ utils::getMessageDescription(const TimelineEvent &event, const QString &localUse
QString
utils::firstChar(const QString &input)
{
- if (!input.isEmpty())
- return QString::fromUcs4(&input.toUcs4().at(0), 1);
+ if (input.isEmpty())
+ return input;
- return input;
+ for (auto const &c : input.toUcs4()) {
+ if (QString::fromUcs4(&c, 1) != QString("#"))
+ return QString::fromUcs4(&c, 1).toUpper();
+ }
+
+ return QString::fromUcs4(&input.toUcs4().at(0), 1).toUpper();
}