Decrypt all events before use

This commit is contained in:
N-Pex 2025-05-13 16:32:09 +02:00
parent 2c5b386af9
commit bf290a5cd7
10 changed files with 44 additions and 34 deletions

View file

@ -757,7 +757,17 @@ export default {
let lastDisplayedEvent = undefined;
events = events.flatMap((e) => {
let result = [];
e.component = this.componentForEvent(e, false);
if (e.isEncrypted()) {
if (e.getClearContent()) {
e.component = this.componentForEvent(e, false);
} else {
this.$matrix.matrixClient.decryptEventIfNeeded(e).then(() => {
e.component = this.componentForEvent(e, false);
});
}
} else {
e.component = this.componentForEvent(e, false);
}
if (e.getId() == this.readMarker && showReadMarker) {
const readMarkerEvent = ROOM_READ_MARKER_EVENT_PLACEHOLDER;
readMarkerEvent["component"] = this.componentForEvent(readMarkerEvent, false);