aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/user.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index 3c61bfd6..dac1bb68 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -215,9 +215,13 @@ bool User::isIgnored() const { return connection()->isIgnored(this); }
QString User::displayname(const Room* room) const
{
- return room ? room->roomMembername(this)
- : d->defaultName.isEmpty() ? d->id
- : d->defaultName;
+ if (room)
+ return room->roomMembername(this);
+
+ if (auto n = name(); !n.isEmpty())
+ return n;
+
+ return d->id;
}
QString User::fullName(const Room* room) const