Skip to content

Commit

Permalink
feat: 🎸 room create timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Apr 22, 2024
1 parent 9a5be2e commit 702af15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/client/puppet-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/server/puppet-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 702af15

Please sign in to comment.