fix: correctly copy msg for forward

This commit is contained in:
Adhiraj Singh
2021-12-20 11:12:21 +05:30
parent ed4f234fd8
commit c1301deda0

View File

@@ -197,7 +197,8 @@ export const generateForwardMessageContent = (
) => {
let content = message.message
if (!content) throw new Boom('no content in message', { statusCode: 400 })
content = JSON.parse(JSON.stringify(content)) // hacky copy
// hacky copy
content = proto.Message.decode(proto.Message.encode(message.message).finish())
let key = Object.keys(content)[0] as MessageType
@@ -381,6 +382,7 @@ export const generateWAMessageFromContent = (
}
}
}
message = WAProto.Message.fromObject(message)
const messageJSON = {