Fixes media upload to channels (#5697)
Ensures correct media upload to channels by using the mimetype from mediaInfo, rather than the file, when creating OpaqueData. Also, it replaces the call to the function getRandomFilehash with the value of the function to retrieve the correct token. Co-authored-by: Noel Carcases <noel.david.carcases.gomez@ibm.com> Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com> Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
This commit is contained in:
parent
303caf9ba2
commit
b03680a70c
1 changed files with 2 additions and 2 deletions
|
|
@ -452,7 +452,7 @@ exports.LoadUtils = () => {
|
||||||
|
|
||||||
window.WWebJS.processMediaData = async (mediaInfo, { forceSticker, forceGif, forceVoice, forceDocument, forceMediaHd, sendToChannel, sendToStatus }) => {
|
window.WWebJS.processMediaData = async (mediaInfo, { forceSticker, forceGif, forceVoice, forceDocument, forceMediaHd, sendToChannel, sendToStatus }) => {
|
||||||
const file = window.WWebJS.mediaInfoToFile(mediaInfo);
|
const file = window.WWebJS.mediaInfoToFile(mediaInfo);
|
||||||
const opaqueData = await window.Store.OpaqueData.createFromData(file, file.type);
|
const opaqueData = await window.Store.OpaqueData.createFromData(file, mediaInfo.mimetype);
|
||||||
const mediaParams = {
|
const mediaParams = {
|
||||||
asSticker: forceSticker,
|
asSticker: forceSticker,
|
||||||
asGif: forceGif,
|
asGif: forceGif,
|
||||||
|
|
@ -506,7 +506,7 @@ exports.LoadUtils = () => {
|
||||||
mimetype: mediaData.mimetype,
|
mimetype: mediaData.mimetype,
|
||||||
mediaObject,
|
mediaObject,
|
||||||
mediaType,
|
mediaType,
|
||||||
...(sendToChannel ? { calculateToken: window.Store.SendChannelMessage.getRandomFilehash() } : {})
|
...(sendToChannel ? { calculateToken: window.Store.SendChannelMessage.getRandomFilehash } : {})
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadedMedia = !sendToChannel
|
const uploadedMedia = !sendToChannel
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue