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

refresh payload for updating #1517

上级 b7ed2149
......@@ -416,16 +416,21 @@ export class Contact extends Accessory implements Sayable {
: newAlias,
)
if (!this.payload) {
throw new Error('no payload')
}
if (typeof newAlias === 'undefined') {
if (!this.payload) {
throw new Error('no payload')
}
return this.payload.alias || null
}
try {
await this.puppet.contactAlias(this.id, newAlias)
this.payload!.alias = newAlias || undefined
await this.puppet.contactPayloadDirty(this.id)
this.payload = await this.puppet.contactPayload(this.id)
if (newAlias && newAlias !== this.payload.alias) {
log.warn('Contact', 'alias(%s) data got is not same as set', newAlias)
}
} catch (e) {
log.error('Contact', 'alias(%s) rejected: %s', newAlias, e.message)
Raven.captureException(e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册