Skip to content

Commit

Permalink
Use getter instead of function
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Feb 21, 2023
1 parent 9e51abc commit e2ffb9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/unit/models/event.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe("MatrixEvent", () => {
expect(encryptedEvent.isEncrypted()).toBeTruthy();
expect(encryptedEvent.isBeingDecrypted()).toBeFalsy();
expect(encryptedEvent.isDecryptionFailure()).toBeTruthy();
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices()).toBeFalsy();
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices).toBeFalsy();
expect(encryptedEvent.getContent()).toEqual({
msgtype: "m.bad.encrypted",
body: "** Unable to decrypt: Error: test error **",
Expand All @@ -144,7 +144,7 @@ describe("MatrixEvent", () => {
expect(encryptedEvent.isEncrypted()).toBeTruthy();
expect(encryptedEvent.isBeingDecrypted()).toBeFalsy();
expect(encryptedEvent.isDecryptionFailure()).toBeTruthy();
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices()).toBeTruthy();
expect(encryptedEvent.isEncryptedDisabledForUnverifiedDevices).toBeTruthy();
expect(encryptedEvent.getContent()).toEqual({
msgtype: "m.bad.encrypted",
body: "** Unable to decrypt: DecryptionError: The sender has disabled encrypting to unverified devices. **",
Expand Down
2 changes: 1 addition & 1 deletion src/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat
return this.clearEvent?.content?.msgtype === "m.bad.encrypted";
}

public isEncryptedDisabledForUnverifiedDevices(): boolean {
public get isEncryptedDisabledForUnverifiedDevices(): boolean {

This comment has been minimized.

Copy link
@t3chguy

t3chguy Feb 21, 2023

Member

I'm not sure this makes sense in english though have no suggestions for better naming here

This comment has been minimized.

Copy link
@florianduros

florianduros Feb 21, 2023

Author Contributor

Yeah, I'm coming with this name I'm not proud about it.

return this.isDecryptionFailure() && this.encryptedDisabledForUnverifiedDevices;
}

Expand Down

0 comments on commit e2ffb9f

Please sign in to comment.