From 0c4dbc6e66047c78458bbcac193189dfc19d93b7 Mon Sep 17 00:00:00 2001 From: NickWang Date: Thu, 11 Jan 2024 18:05:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20room=20dismiss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/puppet-service.ts | 12 ++++++++++++ src/server/puppet-implementation.ts | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/client/puppet-service.ts b/src/client/puppet-service.ts index 511d4149..ebe94c71 100644 --- a/src/client/puppet-service.ts +++ b/src/client/puppet-service.ts @@ -2072,6 +2072,18 @@ class PuppetService extends PUPPET.Puppet { )(request) } + override async roomDismiss (roomId: string): Promise { + log.verbose('PuppetService', 'roomDelAdmins(%s)', roomId) + + const request = new grpcPuppet.RoomDismissRequest() + request.setId(roomId) + + await util.promisify( + this.grpcManager.client.roomDismiss + .bind(this.grpcManager.client), + )(request) + } + /** * * Friendship diff --git a/src/server/puppet-implementation.ts b/src/server/puppet-implementation.ts index a8aaeca7..021048b8 100644 --- a/src/server/puppet-implementation.ts +++ b/src/server/puppet-implementation.ts @@ -1759,6 +1759,20 @@ function puppetImplementation ( } }, + roomDismiss: async (call, callback) => { + log.verbose('PuppetServiceImpl', 'roomDismiss()') + + try { + const roomId = call.request.getId() + + await puppet.roomDismiss(roomId) + + return callback(null, new grpcPuppet.RoomDismissResponse()) + } catch (e) { + return grpcError('roomDelAdmins', e, callback) + } + }, + start: async (call, callback) => { log.verbose('PuppetServiceImpl', 'start()') void call