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:
parent
6d3078fd77
commit
2ac982ee1c
2 changed files with 63 additions and 27 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue