Use client.decryptEvent to avoid accessing js-sdk private members
This commit is contained in:
parent
871c48f69b
commit
1cfd4b6e1a
5 changed files with 14 additions and 28 deletions
|
@ -50,9 +50,8 @@ class FilePanel extends React.Component {
|
|||
if (room?.roomId !== this.props?.roomId) return;
|
||||
if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return;
|
||||
|
||||
if (ev.shouldAttemptDecryption()) {
|
||||
ev.attemptDecryption(room._client._crypto);
|
||||
}
|
||||
const client = MatrixClientPeg.get();
|
||||
client.decryptEvent(ev);
|
||||
|
||||
if (ev.isBeingDecrypted()) {
|
||||
this.decryptingEvents.add(ev.getId());
|
||||
|
|
|
@ -1150,7 +1150,8 @@ class TimelinePanel extends React.Component {
|
|||
.reverse()
|
||||
.forEach(event => {
|
||||
if (event.shouldAttemptDecryption()) {
|
||||
event.attemptDecryption(MatrixClientPeg.get()._crypto);
|
||||
const client = MatrixClientPeg.get();
|
||||
client.decryptEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue