fix: getMessageById false error with group chat message id (#3265)
Messages from Group Chats will have 4 elements in the `params` variable, instead of the 3 for private messages. That's because the `params` variable splits the string by `_`. Group chat messages will have 3 `_` characters instead of 2 for private chat messages. This updates the check to account for group chat messages (which have 4 parameters instead of 3). Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com> Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
This commit is contained in:
parent
1591350144
commit
8fdf2b840e
1 changed files with 1 additions and 1 deletions
|
|
@ -1037,7 +1037,7 @@ class Client extends EventEmitter {
|
|||
if(msg) return window.WWebJS.getMessageModel(msg);
|
||||
|
||||
const params = messageId.split('_');
|
||||
if(params.length !== 3) throw new Error('Invalid serialized message id specified');
|
||||
if (params.length !== 3 && params.length !== 4) throw new Error('Invalid serialized message id specified');
|
||||
|
||||
let messagesObject = await window.Store.Msg.getMessagesById([messageId]);
|
||||
if (messagesObject && messagesObject.messages.length) msg = messagesObject.messages[0];
|
||||
|
|
|
|||
Loading…
Reference in a new issue