Skip to content

Commit e2ffb9f

Browse files
committed
Use getter instead of function
1 parent 9e51abc commit e2ffb9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/unit/models/event.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe("MatrixEvent", () => {
126126
expect(encryptedEvent.isEncrypted()).toBeTruthy();
127127
expect(encryptedEvent.isBeingDecrypted()).toBeFalsy();
128128
expect(encryptedEvent.isDecryptionFailure()).toBeTruthy();
129-
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices()).toBeFalsy();
129+
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices).toBeFalsy();
130130
expect(encryptedEvent.getContent()).toEqual({
131131
msgtype: "m.bad.encrypted",
132132
body: "** Unable to decrypt: Error: test error **",
@@ -144,7 +144,7 @@ describe("MatrixEvent", () => {
144144
expect(encryptedEvent.isEncrypted()).toBeTruthy();
145145
expect(encryptedEvent.isBeingDecrypted()).toBeFalsy();
146146
expect(encryptedEvent.isDecryptionFailure()).toBeTruthy();
147-
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices()).toBeTruthy();
147+
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices).toBeTruthy();
148148
expect(encryptedEvent.getContent()).toEqual({
149149
msgtype: "m.bad.encrypted",
150150
body: "** Unable to decrypt: DecryptionError: The sender has disabled encrypting to unverified devices. **",

src/models/event.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat
711711
return this.clearEvent?.content?.msgtype === "m.bad.encrypted";
712712
}
713713

714-
public isEncryptedDisabledForUnverifiedDevices(): boolean {
714+
public get isEncryptedDisabledForUnverifiedDevices(): boolean {
715715
return this.isDecryptionFailure() && this.encryptedDisabledForUnverifiedDevices;
716716
}
717717

0 commit comments

Comments
 (0)