Merge branch 'grieshofer/request-session-key-for-encrypted-events-in-search' into 'main'

fix: Request session key for bad encrypted events before the text search is carried out

See merge request famedly/company/frontend/famedlysdk!1183
This commit is contained in:
The one with the braid 2022-11-28 08:08:27 +00:00
commit 45dac39153
1 changed files with 5 additions and 0 deletions

View File

@ -593,6 +593,11 @@ class Timeline {
var event = Event.fromMatrixEvent(matrixEvent, room); var event = Event.fromMatrixEvent(matrixEvent, room);
if (event.type == EventTypes.Encrypted && encryption != null) { if (event.type == EventTypes.Encrypted && encryption != null) {
event = await encryption.decryptRoomEvent(room.id, event); event = await encryption.decryptRoomEvent(room.id, event);
if (event.type == EventTypes.Encrypted ||
event.messageType == MessageTypes.BadEncrypted ||
event.content['can_request_session'] == true) {
unawaited(event.requestKey());
}
} }
if (searchFunc(event)) { if (searchFunc(event)) {
yield found..add(event); yield found..add(event);