mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: getChatId
This commit is contained in:
@@ -76,8 +76,12 @@ export const shouldIncrementChatUnread = (message: proto.IWebMessageInfo) => (
|
|||||||
* Get the ID of the chat from the given key.
|
* Get the ID of the chat from the given key.
|
||||||
* Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
|
* Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
|
||||||
*/
|
*/
|
||||||
export const getChatId = ({ remoteJid, participant }: proto.IMessageKey) => {
|
export const getChatId = ({ remoteJid, participant, fromMe }: proto.IMessageKey) => {
|
||||||
if(isJidBroadcast(remoteJid!) && !isJidStatusBroadcast(remoteJid!)) {
|
if(
|
||||||
|
isJidBroadcast(remoteJid!)
|
||||||
|
&& !isJidStatusBroadcast(remoteJid!)
|
||||||
|
&& !fromMe
|
||||||
|
) {
|
||||||
return participant!
|
return participant!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user