Changeset View
Changeset View
Standalone View
Standalone View
src/client/client-model.cpp
| Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | void ClientModel::maybeRotateSessions(ClientModel oldClient) | ||||
| }); | }); | ||||
| }; | }; | ||||
| // Rotate megolm keys for rooms whose users' device list has changed | // Rotate megolm keys for rooms whose users' device list has changed | ||||
| auto changedUsers = deviceLists.diff(oldClient.deviceLists); | auto changedUsers = deviceLists.diff(oldClient.deviceLists); | ||||
| if (! changedUsers.empty()) { | if (! changedUsers.empty()) { | ||||
| for (auto roomId : roomIds) { | for (auto roomId : roomIds) { | ||||
| auto it = std::find_if(changedUsers.begin(), changedUsers.end(), | auto it = std::find_if(changedUsers.begin(), changedUsers.end(), | ||||
| [=](auto userId) { return roomList.rooms[roomId].hasUser(userId); }); | [=, this](auto userId) { return roomList.rooms[roomId].hasUser(userId); }); | ||||
| if (it != changedUsers.end()) { | if (it != changedUsers.end()) { | ||||
| kzo.client.dbg() << "rotate keys for room " << roomId << std::endl; | kzo.client.dbg() << "rotate keys for room " << roomId << std::endl; | ||||
| markRotate(roomId); | markRotate(roomId); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| roomIds = intoImmer( | roomIds = intoImmer( | ||||
| ▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines | |||||