You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Use client.decryptEvent to avoid accessing js-sdk private members
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ export default class MessageActionBar extends React.PureComponent {
|
||||
|
||||
if (this.props.mxEvent.shouldAttemptDecryption()) {
|
||||
const client = MatrixClientPeg.get();
|
||||
this.props.mxEvent.attemptDecryption(client._crypto);
|
||||
client.decryptEvent(this.props.mxEvent);
|
||||
}
|
||||
|
||||
if (this.props.mxEvent.isBeingDecrypted()) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class ViewSourceEvent extends React.PureComponent {
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
if (mxEvent.shouldAttemptDecryption()) {
|
||||
mxEvent.attemptDecryption(client._client._crypto);
|
||||
client.decryptEvent(mxEvent);
|
||||
}
|
||||
|
||||
if (mxEvent.isBeingDecrypted()) {
|
||||
|
||||
Reference in New Issue
Block a user