From ef0809dfcfdbafa4c32ab6e0f183657cd2b1baff Mon Sep 17 00:00:00 2001 From: padlocal Date: Wed, 8 Jun 2022 08:45:40 +0800 Subject: [PATCH] Fix romm member mixin (#198) * fix bug #197 * 1.20.2 --- package.json | 2 +- src/mixins/room-member-mixin.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5ee84003..d3b012d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty-puppet", - "version": "1.20.1", + "version": "1.20.2", "description": "Abstract Puppet for Wechaty", "type": "module", "exports": { diff --git a/src/mixins/room-member-mixin.ts b/src/mixins/room-member-mixin.ts index c354ee29..8b51edf2 100644 --- a/src/mixins/room-member-mixin.ts +++ b/src/mixins/room-member-mixin.ts @@ -39,7 +39,7 @@ const roomMemberMixin = ): Promise { log.verbose('PuppetRoomMemberMixin', 'roomMemberSearch(%s, %s)', roomId, JSON.stringify(query)) - if (!this.id) { + if (!this.isLoggedIn) { throw new Error('no puppet.id. need puppet to be login-ed for a search') } if (!query) { @@ -51,7 +51,7 @@ const roomMemberMixin = */ if (typeof query === 'symbol') { if (query === YOU) { - return [this.id] + return [this.currentUserId] } /** * Huan(202111): We use `symbol` instead of `uniq symbol` in the method argument