From e25f3c0b44879fd4963d409496f33c38bcb2dcd5 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 19 Oct 2021 11:26:43 +1100 Subject: [PATCH] Return proto wrapper instead of proto class --- packages/status-communities/src/wire/community_chat.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/status-communities/src/wire/community_chat.ts b/packages/status-communities/src/wire/community_chat.ts index 915dfd5b..474c2b99 100644 --- a/packages/status-communities/src/wire/community_chat.ts +++ b/packages/status-communities/src/wire/community_chat.ts @@ -1,12 +1,13 @@ import { Reader } from "protobufjs"; -import { ChatIdentity } from "../proto/communities/v1/chat_identity"; import * as proto from "../proto/communities/v1/communities"; import { CommunityMember, CommunityPermissions, } from "../proto/communities/v1/communities"; +import { ChatIdentity } from "./chat_identity"; + export class CommunityChat { public constructor(public proto: proto.CommunityChat) {} @@ -41,7 +42,9 @@ export class CommunityChat { } public get identity(): ChatIdentity | undefined { - return this.proto.identity; + if (!this.proto.identity) return; + + return new ChatIdentity(this.proto.identity); } // TODO: Document this