Skip to content

Commit

Permalink
Fix romm member mixin (#198)
Browse files Browse the repository at this point in the history
* fix bug #197

* 1.20.2
  • Loading branch information
padlocal authored Jun 8, 2022
1 parent 33af5a4 commit ef0809d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechaty-puppet",
"version": "1.20.1",
"version": "1.20.2",
"description": "Abstract Puppet for Wechaty",
"type": "module",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/room-member-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const roomMemberMixin = <MixinBase extends typeof PuppetSkeleton & ContactMixin>
): Promise<string[]> {
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) {
Expand All @@ -51,7 +51,7 @@ const roomMemberMixin = <MixinBase extends typeof PuppetSkeleton & ContactMixin>
*/
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
Expand Down

0 comments on commit ef0809d

Please sign in to comment.