aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index c4cdac04..b34c36ea 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1201,15 +1201,13 @@ QString Room::decryptMessage(QByteArray cipher, const QString& senderKey,
int Room::joinedCount() const
{
- return d->summary.joinedMemberCount.omitted()
- ? d->membersMap.size()
- : d->summary.joinedMemberCount.value();
+ return d->summary.joinedMemberCount.value_or(d->membersMap.size());
}
int Room::invitedCount() const
{
// TODO: Store invited users in Room too
- Q_ASSERT(!d->summary.invitedMemberCount.omitted());
+ Q_ASSERT(d->summary.invitedMemberCount.has_value());
return d->summary.invitedMemberCount.value();
}
@@ -2620,9 +2618,8 @@ QString Room::Private::calculateDisplayname() const
const bool emptyRoom =
membersMap.isEmpty()
|| (membersMap.size() == 1 && isLocalUser(*membersMap.begin()));
- const bool nonEmptySummary =
- !summary.heroes.omitted() && !summary.heroes->empty();
- auto shortlist = nonEmptySummary ? buildShortlist(summary.heroes.value())
+ const bool nonEmptySummary = summary.heroes && !summary.heroes->empty();
+ auto shortlist = nonEmptySummary ? buildShortlist(*summary.heroes)
: !emptyRoom ? buildShortlist(membersMap)
: users_shortlist_t {};