Skip to content

Commit

Permalink
Expose timestamp to other plugins, don't overwrite sending timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
FieryFlames committed Jul 21, 2023
1 parent 37d7caa commit a11b52b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ export default {
// Return if it's not a message row
if (row.rowType !== 1) return
if (storage.separateMessages) row.isFirst = true
row.message.__customTimestamp = renderTimestamp(row.message.timestamp)
}))

patches.push(after("generate", RowManager.prototype, ([row], { message }) => {
// Return if it's not a message row
if (row.rowType !== 1) return
if (message.timestamp) message.timestamp = renderTimestamp(row.message.timestamp, storage.selected)
if (row.message.__customTimestamp &&
message.state === "SENT" &&
message.timestamp) message.timestamp = row.message.__customTimestamp
}))
},
onUnload: () => {
Expand Down

0 comments on commit a11b52b

Please sign in to comment.