fix: message_edit event and edit caption in file (#2617)

* edit caption

* Update Client.js

* refactor: events combined into one line

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
This commit is contained in:
tofers 2023-12-05 15:50:55 +03:00 • committed by GitHub
commit 3dab4a3f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -644,7 +644,7 @@ class Message extends Base {
let msg = window.Store.Msg.get(msgId);
if (!msg) return null;
let catEdit = (msg.type === 'chat' && window.Store.MsgActionChecks.canEditText(msg));
let catEdit = window.Store.MsgActionChecks.canEditText(msg) || window.Store.MsgActionChecks.canEditCaption(msg);
if (catEdit) {
const msgEdit = await window.WWebJS.editMessage(msg, message, options);
return msgEdit.serialize();