diff --git a/src/Conversation.ts b/src/Conversation.ts index 958373b8..898b172d 100644 --- a/src/Conversation.ts +++ b/src/Conversation.ts @@ -23,5 +23,8 @@ export class Conversation { get members() { return this.channel.presence; + + async delete() { + await this.chatApi.deleteConversation(this.conversationId); } } diff --git a/src/Conversations.ts b/src/Conversations.ts index b9eb86a7..9332edb5 100644 --- a/src/Conversations.ts +++ b/src/Conversations.ts @@ -21,4 +21,13 @@ export class Conversations { return conversation; } + + async release(conversationId: string) { + const conversation = this.conversations[conversationId]; + if (!conversation) { + return; + } + delete this.conversations[conversationId]; + await conversation.delete(); + } }