提交 5d389fad 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)
上级 db9dd130
......@@ -5,8 +5,7 @@
"main": "dist/src/mod.js",
"typings": "dist/src/mod.d.ts",
"engines": {
"node": ">= 12",
"wechaty-puppet": ">=0.31.1"
"node": ">= 12"
},
"wechaty": {
"DEFAULT_PORT": 8080,
......@@ -103,7 +102,7 @@
"typed-emitter": "^1.2.0",
"watchdog": "^0.8.17",
"wechaty-puppet-hostie": "^0.9.13",
"wechaty-puppet": "^0.31.1",
"wechaty-puppet": "^0.31.4",
"ws": "^7.2.3"
},
"devDependencies": {
......
......@@ -25,6 +25,7 @@ import {
ContactQueryFilter,
ContactType,
FileBox,
PayloadType,
} from 'wechaty-puppet'
import { Wechaty } from '../wechaty'
......@@ -522,7 +523,7 @@ class Contact extends ContactEventEmitter implements Sayable {
try {
await this.wechaty.puppet.contactAlias(this.id, newAlias)
await this.wechaty.puppet.contactPayloadDirty(this.id)
await this.wechaty.puppet.dirtyPayload(PayloadType.Contact, this.id)
this.payload = await this.wechaty.puppet.contactPayload(this.id)
if (newAlias && newAlias !== this.payload.alias) {
log.warn('Contact', 'alias(%s) sync with server fail: set(%s) is not equal to get(%s)',
......@@ -574,7 +575,7 @@ class Contact extends ContactEventEmitter implements Sayable {
try {
await this.wechaty.puppet.contactPhone(this.id, phoneList)
await this.wechaty.puppet.contactPayloadDirty(this.id)
await this.wechaty.puppet.dirtyPayload(PayloadType.Contact, this.id)
this.payload = await this.wechaty.puppet.contactPayload(this.id)
} catch (e) {
log.error('Contact', 'phone(%s) rejected: %s', JSON.stringify(phoneList), e.message)
......@@ -810,7 +811,7 @@ class Contact extends ContactEventEmitter implements Sayable {
try {
if (forceSync) {
await this.wechaty.puppet.contactPayloadDirty(this.id)
await this.wechaty.puppet.dirtyPayload(PayloadType.Contact, this.id)
}
this.payload = await this.wechaty.puppet.contactPayload(this.id)
// log.silly('Contact', `ready() this.wechaty.puppet.contactPayload(%s) resolved`, this)
......
......@@ -45,6 +45,7 @@ import {
RoomMemberQueryFilter,
RoomPayload,
RoomQueryFilter,
PayloadType,
} from 'wechaty-puppet'
import { RoomEventEmitter } from '../events/room-events'
......@@ -339,8 +340,8 @@ class Room extends RoomEventEmitter implements Sayable {
}
if (forceSync) {
await this.wechaty.puppet.roomPayloadDirty(this.id)
await this.wechaty.puppet.roomMemberPayloadDirty(this.id)
await this.wechaty.puppet.dirtyPayload(PayloadType.Room, this.id)
await this.wechaty.puppet.dirtyPayload(PayloadType.RoomMember, this.id)
}
this.payload = await this.wechaty.puppet.roomPayload(this.id)
......
......@@ -30,6 +30,7 @@ import {
PUPPET_EVENT_DICT,
PuppetEventName,
PuppetOptions,
PayloadType,
} from 'wechaty-puppet'
import {
......@@ -552,8 +553,8 @@ export class Wechaty extends WechatyEventEmitter implements Sayable {
// issue #254
const selfId = this.puppet.selfId()
if (selfId && payload.removeeIdList.includes(selfId)) {
await this.puppet.roomPayloadDirty(payload.roomId)
await this.puppet.roomMemberPayloadDirty(payload.roomId)
await this.puppet.dirtyPayload(PayloadType.Room, payload.roomId)
await this.puppet.dirtyPayload(PayloadType.RoomMember, payload.roomId)
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册