From 702af15a9dfd076a20ab98210222ee4f025292bd Mon Sep 17 00:00:00 2001 From: NickWang Date: Mon, 22 Apr 2024 10:56:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20room=20create=20timestam?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/client/puppet-service.ts | 5 +++++ src/server/puppet-implementation.ts | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e34f834f..50b75cf3 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@chatie/eslint-config": "^1.0.4", "@chatie/semver": "^0.4.7", "@chatie/tsconfig": "^4.6.3", - "@juzi/wechaty-puppet": "^1.0.87", + "@juzi/wechaty-puppet": "^1.0.88", "@juzi/wechaty-puppet-mock": "^1.0.1", "@swc/core": "1.3.39", "@types/google-protobuf": "^3.15.5", @@ -73,7 +73,7 @@ "@juzi/wechaty-puppet": "^1.0.84" }, "dependencies": { - "@juzi/wechaty-grpc": "^1.0.83", + "@juzi/wechaty-grpc": "^1.0.84", "clone-class": "^1.1.1", "ducks": "^1.0.2", "file-box": "^1.5.5", diff --git a/src/client/puppet-service.ts b/src/client/puppet-service.ts index c580247e..169f7a13 100644 --- a/src/client/puppet-service.ts +++ b/src/client/puppet-service.ts @@ -1639,6 +1639,11 @@ class PuppetService extends PUPPET.Puppet { external : response.getExternal(), } + const createTime = response.getCreateTime() + if (createTime) { + payload.createTime = millisecondsFromTimestamp(createTime) + } + await this._payloadStore.room?.set(id, payload) log.silly('PuppetService', 'roomRawPayload(%s) cache SET', id) diff --git a/src/server/puppet-implementation.ts b/src/server/puppet-implementation.ts index a35a7aa4..1029ca07 100644 --- a/src/server/puppet-implementation.ts +++ b/src/server/puppet-implementation.ts @@ -1618,6 +1618,9 @@ function puppetImplementation ( response.setAdditionalInfo(payload.additionalInfo || '') response.setRoomRemark(payload.remark || '') response.setExternal(!!payload.external) + if (payload.createTime) { + response.setCreateTime(timestampFromMilliseconds(payload.createTime)) + } return callback(null, response)