Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions src/util/Injected/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,18 +537,26 @@
if (isStatus) {
const { backgroundColor, fontStyle } = extraOptions;
const isMedia = Object.keys(mediaOptions).length > 0;
const mediaUpdate = (data) =>
window.require('WAWebMediaUpdateMsg')(data, mediaOptions);

const mediaMsgData = {
...message,
from: from,
to: chat.id,
author: from,
};

const msg = new (window.require('WAWebCollections').Msg.modelClass)(
{
...message,
author: participant ? participant : null,
messageSecret: window.crypto.getRandomValues(
new Uint8Array(32),
),
// Guarded: this gating helper is absent from some WhatsApp Web
// builds and would otherwise throw while building the model.
cannotBeRanked: window

Check failure on line 557 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / ESLint

Insert `⏎·······················`

Check failure on line 557 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / Tests

Insert `⏎·······················`
.require('WAWebStatusGatingUtils')

Check failure on line 558 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / ESLint

Insert `····`

Check failure on line 558 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / Tests

Insert `····`
.canCheckStatusRankingPosterGating(),
.canCheckStatusRankingPosterGating?.() ?? false,

Check failure on line 559 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / ESLint

Insert `····`

Check failure on line 559 in src/util/Injected/Utils.js

View workflow job for this annotation

GitHub Actions / Tests

Insert `····`
},
);

Expand All @@ -568,9 +576,23 @@
isMedia
? 'sendStatusMediaMsgAction'
: 'sendStatusTextMsgAction'
](...(isMedia ? [msg, mediaUpdate] : [statusOptions]));
](
...(isMedia
? [
{
mediaMsgData,
beforeSend: async () => {},
funnelContext: undefined,
},
]
: [statusOptions]),
);

return msg;
return isMedia
? new (window.require('WAWebCollections').Msg.modelClass)(
mediaMsgData,
)
: msg;
}

const [msgPromise, sendMsgResultPromise] = window
Expand Down
Loading