Don't play notification sound when msg.fromMe
This commit is contained in:
parent
3ba0f9792c
commit
9480c600f9
3 changed files with 12 additions and 2 deletions
6
app.js
6
app.js
|
|
@ -115,6 +115,8 @@ function handleIncomingMessage(msg) {
|
|||
if (!msg) return;
|
||||
|
||||
// console.log('[WS] handleIncomingMessage payload:', msg);
|
||||
|
||||
ui.updateChatInChatList(msg);
|
||||
|
||||
const rawChatId = msg.chatId || msg.from || (msg.chat && msg.chat.id);
|
||||
const msgChatId = normalizeChatId(rawChatId);
|
||||
|
|
@ -124,7 +126,9 @@ function handleIncomingMessage(msg) {
|
|||
}
|
||||
|
||||
// console.log('[WS] Resolved msgChatId:', msgChatId, '| activeChatState:', activeChatState?.id);
|
||||
messageTone.play();
|
||||
if (msg.fromMe) {
|
||||
messageTone.play();
|
||||
}
|
||||
|
||||
if (activeChatState && activeChatState.id === msgChatId) {
|
||||
const msgId = normalizeChatId(msg.id) || msg.id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue