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

code clean

上级 211737c2
......@@ -87,10 +87,6 @@ export class Message extends PuppetAccessory implements Sayable {
]
}
public static create(options: MessageMOOptions): Message {
return this.createMO(options)
}
/**
* "mobile originated" or "mobile terminated"
* https://www.tatango.com/resources/video-lessons/video-mo-mt-sms-messaging/
......@@ -98,8 +94,7 @@ export class Message extends PuppetAccessory implements Sayable {
public static createMO(
options: MessageMOOptions,
): Message {
log.verbose('Message', 'static createMobileOriginated()',
)
log.verbose('Message', 'static createMobileOriginated()')
/**
* Must NOT use `Message` at here
* MUST use `this` at here
......@@ -189,6 +184,10 @@ export class Message extends PuppetAccessory implements Sayable {
return msg
}
public static create(options: MessageMOOptions): Message {
return this.createMO(options)
}
/**
*
* Instance Properties
......
......@@ -82,9 +82,8 @@ import {
// FriendRequest,
// } from '../puppet/friend-request'
import {
ScanFoodType,
} from './puppet-puppeteer.type'
export type PuppetFoodType = 'scan' | 'ding'
export type ScanFoodType = 'scan' | 'login' | 'logout'
export class PuppetPuppeteer extends Puppet {
public bridge : Bridge
......@@ -379,6 +378,7 @@ export class PuppetPuppeteer extends Puppet {
return MessageType.Text
case WebMessageType.SYS:
// FriendRequest is a SYS message
// FIXME: should we use better message type at here???
return MessageType.Text
......
export type PuppetFoodType = 'scan' | 'ding'
export type ScanFoodType = 'scan' | 'login' | 'logout'
......@@ -106,6 +106,9 @@ test('PuppetPuppeteerFriendRequest.confirm smoke testing', async t => {
sandbox.stub((puppet as any), 'messageRawPayload').callsFake(mockMessageRawPayload)
sandbox.stub(puppet, 'contactPayload') .callsFake(mockContactPayload)
// ;
// (puppet as any).messageRawPayload()
const msg = wechaty.Message.createMT(rawMessagePayload.MsgId)
await msg.ready()
......@@ -117,5 +120,6 @@ test('PuppetPuppeteerFriendRequest.confirm smoke testing', async t => {
t.true(fr.contact() instanceof Contact, 'should have a Contact instance')
t.is(fr.type(), wechaty.FriendRequest.Type.Confirm, 'should be confirm type')
// t.ok('ok')
sandbox.restore()
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册