aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-10-31 12:48:49 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-11-01 08:43:10 +0900
commitedbbc2bc77599ead0e14bc08cdddda10d1c5f305 (patch)
tree4bb8be8e6ee370d943516c9ba197fb12c8377ea8 /lib/connection.cpp
parent60bb1cf942ad0815dcf42cbfe8acd1e076d848cf (diff)
downloadlibquotient-edbbc2bc77599ead0e14bc08cdddda10d1c5f305.tar.gz
libquotient-edbbc2bc77599ead0e14bc08cdddda10d1c5f305.zip
Omittable: get rid of value()
Xcode 10 doesn't have it, and value() is not quite fitting mostly-exceptionless Quotient anyway.
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 47c643b0..998b45d1 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -1182,7 +1182,7 @@ Room* Connection::provideRoom(const QString& id, Omittable<JoinState> joinState)
// TODO: This whole function is a strong case for a RoomManager class.
Q_ASSERT_X(!id.isEmpty(), __FUNCTION__, "Empty room id");
- // If joinState.omitted(), all joinState == comparisons below are false.
+ // If joinState is empty, all joinState == comparisons below are false.
const auto roomKey = qMakePair(id, joinState == JoinState::Invite);
auto* room = d->roomMap.value(roomKey, nullptr);
if (room) {
@@ -1214,17 +1214,17 @@ Room* Connection::provideRoom(const QString& id, Omittable<JoinState> joinState)
if (!joinState)
return room;
- if (joinState == JoinState::Invite) {
+ if (*joinState == JoinState::Invite) {
// prev is either Leave or nullptr
auto* prev = d->roomMap.value({ id, false }, nullptr);
emit invitedRoom(room, prev);
} else {
- room->setJoinState(joinState.value());
+ room->setJoinState(*joinState);
// Preempt the Invite room (if any) with a room in Join/Leave state.
auto* prevInvite = d->roomMap.take({ id, true });
- if (joinState == JoinState::Join)
+ if (*joinState == JoinState::Join)
emit joinedRoom(room, prevInvite);
- else if (joinState == JoinState::Leave)
+ else if (*joinState == JoinState::Leave)
emit leftRoom(room, prevInvite);
if (prevInvite) {
const auto dcUsers = prevInvite->directChatUsers();