fix: return poll vote reactions (#3694)

* wip: return poll vote reactions

* wip: add module

* wip: return poll vote reactions

* wip: return poll vote reactions

* Update Client.js

* Update PollVote.js

* wip: use async getMessagesById

* Update Client.js

* style: clean shit

* style: reformat code

---------

Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
This commit is contained in:
alechkos 2025-08-28 11:32:37 +03:00 • committed by GitHub
commit 2ac982ee1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 63 additions and 27 deletions

View file

@ -96,6 +96,7 @@ exports.ExposeStore = () => {
window.Store.DeviceList = window.require('WAWebApiDeviceList');
window.Store.HistorySync = window.require('WAWebSendNonMessageDataRequest');
window.Store.AddonReactionTable = window.require('WAWebAddonReactionTableMode').reactionTableMode;
window.Store.AddonPollVoteTable = window.require('WAWebAddonPollVoteTableMode').pollVoteTableMode;
window.Store.PinnedMsgUtils = window.require('WAWebPinInChatSchema');
window.Store.ChatGetters = window.require('WAWebChatGetters');
window.Store.PinnedMsgUtils = window.require('WAWebSendPinMessageAction');

View file

@ -523,15 +523,6 @@ exports.LoadUtils = () => {
return msg;
};
window.WWebJS.getPollVoteModel = async (vote) => {
const _vote = vote.serialize();
if (!vote.parentMsgKey) return null;
const msg =
window.Store.Msg.get(vote.parentMsgKey) || (await window.Store.Msg.getMessagesById([vote.parentMsgKey]))?.messages?.[0];
msg && (_vote.parentMessage = window.WWebJS.getMessageModel(msg));
return _vote;
};
window.WWebJS.getChat = async (chatId, { getAsModel = true } = {}) => {
const isChannel = /@\w*newsletter\b/.test(chatId);
const chatWid = window.Store.WidFactory.createWid(chatId);