diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-16 14:44:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 14:44:08 +0100 |
commit | d5515bb6dd8ebf46aa36a8bc696b90a573a8492c (patch) | |
tree | 44d16d64c81944db00502a9ddb993f082280b996 /lib/room.cpp | |
parent | a16509d7fad5a0856ad83d0ef33b7b9d205efdd8 (diff) | |
parent | cb7b9e8d04f060893a5ffb8cfa22c627c7dbe507 (diff) | |
download | libquotient-d5515bb6dd8ebf46aa36a8bc696b90a573a8492c.tar.gz libquotient-d5515bb6dd8ebf46aa36a8bc696b90a573a8492c.zip |
Merge pull request #520 from TobiasFella/implicitthiscapture
Port away from implicit 'this' captures in lambdas
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index c2c4ba78..ecc9859d 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -572,13 +572,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 {}; } @@ -860,7 +860,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 @@ -1972,7 +1972,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()); }); |