feat: add preview message to chats
This commit is contained in:
Vendored
+3
-1
@@ -2,7 +2,7 @@
|
||||
// ==UserScript==
|
||||
// @name WhatsApp Web Bridge
|
||||
// @namespace https://rul.sh/
|
||||
// @version 0.0.2
|
||||
// @version 0.0.3
|
||||
// @description WhatsApp Web WebSocket bridge
|
||||
// @match https://web.whatsapp.com/*
|
||||
// @updateURL https://git.rul.sh/khairul169/whatsapp-bridge/raw/branch/main/dist/whatsapp-bridge.user.js
|
||||
@@ -93,6 +93,7 @@
|
||||
return Object.keys(result).length ? result : String(id);
|
||||
}
|
||||
function serializeChat(chat) {
|
||||
const rawPreviewMessage = safeProperty(chat, "previewMessage");
|
||||
return {
|
||||
id: serializeId(chat.id),
|
||||
accountLid: chat.accountLid,
|
||||
@@ -103,6 +104,7 @@
|
||||
isReadOnly: chat.isReadOnly,
|
||||
archived: chat.archived,
|
||||
unreadCount: chat.unreadCount,
|
||||
previewMessage: rawPreviewMessage ? serialize(rawPreviewMessage) : null,
|
||||
timestamp: chat.t,
|
||||
lastMessage: chat.lastMessage ? serialize(chat.lastMessage) : null
|
||||
};
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user