fix: fix edit message (#192)

This commit is contained in:
BochilGaming
2023-07-01 04:19:34 +07:00
committed by GitHub
parent 2dad94b1f0
commit 8e1e9b9386
2 changed files with 5 additions and 1 deletions

View File

@@ -732,6 +732,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
}
)
const isDeleteMsg = 'delete' in content && !!content.delete
const isEditMsg = 'edit' in content && !!content.edit
const additionalAttributes: BinaryNodeAttributes = { }
// required for delete
if(isDeleteMsg) {
@@ -741,6 +742,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
} else {
additionalAttributes.edit = '7'
}
} else if(isEditMsg) {
additionalAttributes.edit = '1'
}
await relayMessage(jid, fullMsg.message!, { messageId: fullMsg.key.id!, cachedGroupMetadata: options.cachedGroupMetadata, additionalAttributes })
@@ -756,4 +759,4 @@ export const makeMessagesSocket = (config: SocketConfig) => {
}
}
}
}
}

View File

@@ -493,6 +493,7 @@ export const generateWAMessageContent = async(
protocolMessage: {
key: message.edit,
editedMessage: m,
timestampMs: Date.now(),
type: WAProto.Message.ProtocolMessage.Type.MESSAGE_EDIT
}
}