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

This commit is contained in:
Philipp Grieshofer 2022-11-28 08:08:26 +00:00 committed by The one with the braid
parent 614bc38de2
commit 789527c256
1 changed files with 5 additions and 0 deletions

View File

@ -593,6 +593,11 @@ class Timeline {
var event = Event.fromMatrixEvent(matrixEvent, room);
if (event.type == EventTypes.Encrypted && encryption != null) {
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)) {
yield found..add(event);