From fd454f1e2044ca34349d5d2309f5a169bda8f4ce Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 27 Apr 2021 14:26:40 +0200 Subject: [PATCH] don't expose joinRule prop, as it is protocol specific --- src/matrix/room/Invite.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/matrix/room/Invite.js b/src/matrix/room/Invite.js index 4ce74ea8..d34ffa8e 100644 --- a/src/matrix/room/Invite.js +++ b/src/matrix/room/Invite.js @@ -68,8 +68,12 @@ export class Invite extends EventEmitter { return this._inviter; } - get joinRule() { - return this._inviteData.joinRule; + get isPublic() { + return this._inviteData.joinRule === "public"; + } + + get canonicalAlias() { + return this._inviteData.canonicalAlias; } async accept(log = null) { @@ -276,7 +280,7 @@ export function tests() { invite.afterSync(changes); assert.equal(invite.name, "Invite example"); assert.equal(invite.avatarUrl, roomAvatarUrl); - assert.equal(invite.joinRule, "invite"); + assert.equal(invite.isPublic, false); assert.equal(invite.timestamp, 1001); assert.equal(invite.isEncrypted, false); assert.equal(invite.isDirectMessage, false);