From 501d9d50d439a0cedab747aedf856682166dc3d9 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 19 Oct 2021 11:25:31 +1100 Subject: [PATCH] Add getters --- .../src/wire/chat_identity.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/status-communities/src/wire/chat_identity.ts b/packages/status-communities/src/wire/chat_identity.ts index 90bc9dc..b43c8ec 100644 --- a/packages/status-communities/src/wire/chat_identity.ts +++ b/packages/status-communities/src/wire/chat_identity.ts @@ -1,6 +1,7 @@ import { Reader } from "protobufjs"; import * as proto from "../proto/communities/v1/chat_identity"; +import { IdentityImage } from "../proto/communities/v1/chat_identity"; export class ChatIdentity { public constructor(public proto: proto.ChatIdentity) {} @@ -14,4 +15,37 @@ export class ChatIdentity { encode(): Uint8Array { return proto.ChatIdentity.encode(this.proto).finish(); } + + /** Lamport timestamp of the message */ + get clock(): number | undefined { + return this.proto.clock; + } + + /** ens_name is the valid ENS name associated with the chat key */ + get ensName(): string | undefined { + return this.proto.ensName; + } + + /** images is a string indexed mapping of images associated with an identity */ + get images(): { [key: string]: IdentityImage } | undefined { + return this.proto.images; + } + + /** display name is the user set identity, valid only for organisations */ + get displayName(): string | undefined { + return this.proto.displayName; + } + + /** description is the user set description, valid only for organisations */ + get description(): string | undefined { + return this.proto.description; + } + + get color(): string | undefined { + return this.proto.color; + } + + get emoji(): string | undefined { + return this.proto.emoji; + } }