diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-17 18:38:03 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-17 18:38:03 +0100 |
commit | 0052c0b2b4f9860ee9223ef161f40929e7c4c454 (patch) | |
tree | 4a2a869a2ce437ba17c7269e8e904276a11db62a | |
parent | b472fc355dc5ce70391ca2b9bc8da35b973ae3a3 (diff) | |
parent | d5515bb6dd8ebf46aa36a8bc696b90a573a8492c (diff) | |
download | libquotient-0052c0b2b4f9860ee9223ef161f40929e7c4c454.tar.gz libquotient-0052c0b2b4f9860ee9223ef161f40929e7c4c454.zip |
Merge branch 'dev' into kitsune-fix-read-receipts-and-markers
# Conflicts:
# lib/room.cpp
-rw-r--r-- | lib/room.cpp | 12 | ||||
-rw-r--r-- | lib/user.cpp | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 273a5753..a06a8d2a 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -573,13 +573,13 @@ QImage Room::avatar(int width, int height) { if (!d->avatar.url().isEmpty()) return d->avatar.get(connection(), width, height, - [=] { emit avatarChanged(); }); + [this] { emit avatarChanged(); }); // Use the first (excluding self) user's avatar for direct chats const auto dcUsers = directChatUsers(); for (auto* u : dcUsers) if (u != localUser()) - return u->avatar(width, height, this, [=] { emit avatarChanged(); }); + return u->avatar(width, height, this, [this] { emit avatarChanged(); }); return {}; } @@ -915,7 +915,7 @@ void Room::Private::getAllMembers() allMembersJob = connection->callApi<GetMembersByRoomJob>( id, connection->nextBatchToken(), "join"); auto nextIndex = timeline.empty() ? 0 : timeline.back().index() + 1; - connect(allMembersJob, &BaseJob::success, q, [=] { + connect(allMembersJob, &BaseJob::success, q, [this, nextIndex] { Q_ASSERT(timeline.empty() || nextIndex <= q->maxTimelineIndex() + 1); auto roomChanges = updateStateFrom(allMembersJob->chunk()); // Replay member events that arrived after the point for which @@ -2053,7 +2053,7 @@ void Room::Private::getPreviousContent(int limit, const QString &filter) eventsHistoryJob = connection->callApi<GetRoomEventsJob>(id, prevBatch, "b", "", limit, filter); emit q->eventsHistoryJobChanged(); - connect(eventsHistoryJob, &BaseJob::success, q, [=] { + connect(eventsHistoryJob, &BaseJob::success, q, [this] { prevBatch = eventsHistoryJob->end(); addHistoricalMessageEvents(eventsHistoryJob->chunk()); }); @@ -2878,7 +2878,9 @@ Room::Changes Room::processAccountDataEvent(EventPtr&& event) << currentData->matrixType(); emit accountDataChanged(currentData->matrixType()); // TODO: Drop AccountDataChange in 0.8 - QT_IGNORE_DEPRECATIONS(changes |= AccountDataChange|OtherChange); + // NB: GCC (at least 10) only accepts QT_IGNORE_DEPRECATIONS around + // a statement, not within a statement + QT_IGNORE_DEPRECATIONS(changes |= AccountDataChange | OtherChange;) } return changes; } diff --git a/lib/user.cpp b/lib/user.cpp index 88549e5d..7da71dba 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -66,7 +66,7 @@ User::~User() = default; void User::load() { auto* profileJob = - connection()->callApi<GetUserProfileJob>(QUrl::toPercentEncoding(id())); + connection()->callApi<GetUserProfileJob>(id()); connect(profileJob, &BaseJob::result, this, [this, profileJob] { d->defaultName = profileJob->displayname(); d->defaultAvatar = Avatar(QUrl(profileJob->avatarUrl())); |