diff --git a/src/chat/patch.ts b/src/chat/patch.ts index d9ab0064b0..6e85460ddc 100644 --- a/src/chat/patch.ts +++ b/src/chat/patch.ts @@ -17,6 +17,7 @@ import * as webpack from '../webpack'; import { wrapModuleFunction } from '../whatsapp/exportModule'; import { + isUnreadTypeMsg, mediaTypeFromProtobuf, typeAttributeFromProtobuf, } from '../whatsapp/functions'; @@ -63,6 +64,23 @@ function applyPatch() { return func(...args); }); + + /** + * Reinforce unread messages for buttons and lists + */ + wrapModuleFunction(isUnreadTypeMsg, (func, ...args) => { + const [msg] = args; + + switch (msg.type) { + case 'buttons_response': + case 'list': + case 'list_response': + case 'template_button_reply': + return true; + } + + return func(...args); + }); } /**