提交 a70b4da0 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

support search YOU in room

上级 267941dd
...@@ -69,6 +69,7 @@ import { ...@@ -69,6 +69,7 @@ import {
Receiver, Receiver,
WATCHDOG_TIMEOUT, WATCHDOG_TIMEOUT,
YOU,
} from './schemas/puppet' } from './schemas/puppet'
const DEFAULT_WATCHDOG_TIMEOUT = 60 const DEFAULT_WATCHDOG_TIMEOUT = 60
...@@ -661,10 +662,21 @@ export abstract class Puppet extends EventEmitter implements Sayable { ...@@ -661,10 +662,21 @@ export abstract class Puppet extends EventEmitter implements Sayable {
public async roomMemberSearch( public async roomMemberSearch(
roomId : string, roomId : string,
query : string | RoomMemberQueryFilter, query : (YOU | string) | RoomMemberQueryFilter,
): Promise<string[]> { ): Promise<string[]> {
log.verbose('Puppet', 'roomMemberSearch(%s, %s)', roomId, JSON.stringify(query)) log.verbose('Puppet', 'roomMemberSearch(%s, %s)', roomId, JSON.stringify(query))
if (!this.id) {
throw new Error('no puppet.id')
}
/**
* 0. for YOU: 'You', '你'
*/
if (query === YOU) {
return [this.id]
}
/** /**
* 1. for Text Query * 1. for Text Query
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册