aboutsummaryrefslogtreecommitdiff
path: root/lib/user.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.cpp')
-rw-r--r--lib/user.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index eec08ad9..eec41957 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -312,6 +312,11 @@ void User::unmarkIgnore()
connection()->removeFromIgnoredUsers(this);
}
+bool User::isIgnored() const
+{
+ return connection()->isIgnored(this);
+}
+
void User::Private::setAvatarOnServer(QString contentUri, User* q)
{
auto* j = connection->callApi<SetAvatarUrlJob>(userId, contentUri);
@@ -321,14 +326,16 @@ void User::Private::setAvatarOnServer(QString contentUri, User* q)
QString User::displayname(const Room* room) const
{
- auto name = d->nameForRoom(room);
- return name.isEmpty() ? d->userId :
- room ? room->roomMembername(this) : name;
+ if (room)
+ return room->roomMembername(this);
+
+ const auto name = d->nameForRoom(nullptr);
+ return name.isEmpty() ? d->userId : name;
}
QString User::fullName(const Room* room) const
{
- auto name = d->nameForRoom(room);
+ const auto name = d->nameForRoom(room);
return name.isEmpty() ? d->userId : name % " (" % d->userId % ')';
}