mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
patch messages.update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import BinaryNode from "../BinaryNode";
|
||||
import { EventEmitter } from 'events'
|
||||
import { Chat, Contact, Presence, PresenceData, SocketConfig, WAFlag, WAMetric, WABusinessProfile, ChatModification, WAMessageKey, WAMessage } from "../Types";
|
||||
import { Chat, Contact, Presence, PresenceData, SocketConfig, WAFlag, WAMetric, WABusinessProfile, ChatModification, WAMessageKey, WAMessage, WAMessageUpdate } from "../Types";
|
||||
import { debouncedTimeout, unixTimestampSeconds, whatsappID } from "../Utils/generics";
|
||||
import makeAuthSocket from "./auth";
|
||||
import { Attributes, BinaryNode as BinaryNodeBase } from "../BinaryNode/types";
|
||||
@@ -67,14 +67,14 @@ const makeChatsSocket = (config: SocketConfig) => {
|
||||
case 'star':
|
||||
case 'unstar':
|
||||
const starred = updateType === 'star'
|
||||
const updates: Partial<WAMessage>[] = (node.data as BinaryNode[]).map(
|
||||
const updates: WAMessageUpdate[] = (node.data as BinaryNode[]).map(
|
||||
({ attributes }) => ({
|
||||
key: {
|
||||
remoteJid: jid,
|
||||
id: attributes.index,
|
||||
fromMe: attributes.owner === 'true'
|
||||
},
|
||||
starred
|
||||
update: { starred }
|
||||
})
|
||||
)
|
||||
ev.emit('messages.update', updates)
|
||||
|
||||
Reference in New Issue
Block a user