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

code clean

上级 99f8698a
......@@ -161,8 +161,7 @@ async function onLogin(
log.warn('PuppetPuppeteerEvent', 'readyStable() exception: %s', e && e.message || e)
}
this.login(user)
// this.emit('login', user)
this.login(userId)
} catch (e) {
log.error('PuppetPuppeteerEvent', 'onLogin() exception: %s', e)
......
......@@ -569,10 +569,10 @@ export class PuppetPuppeteer extends Puppet {
}
}
public async login(user: Contact): Promise<void> {
log.warn('PuppetPuppeteer', 'login(%s)', user)
this.userId = user.id
this.emit('login', user)
public async login(userId: string): Promise<void> {
log.verbose('PuppetPuppeteer', 'login(%s)', userId)
this.userId = userId
this.emit('login', this.Contact.load(userId))
}
/**
......
......@@ -63,7 +63,7 @@ const puppet = new PuppetPuppeteer({
(wechaty as any).initPuppetAccessory(puppet)
const MOCK_USER_ID = 'TEST-USER-ID'
puppet.login(wechaty.Contact.load(MOCK_USER_ID))
puppet.login(MOCK_USER_ID)
test('constructor()', async t => {
/* tslint:disable:max-line-length */
......
......@@ -424,7 +424,7 @@ export class Wechaty extends PuppetAccessory implements Sayable {
log.verbose('Wechaty', 'initPuppet()')
if (!this.options.puppet) {
log.warn('Wechaty', 'initPuppet() using default puppet: %s', config.puppet)
log.info('Wechaty', 'initPuppet() using default puppet: %s', config.puppet)
this.options.puppet = config.puppet
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册