mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
sticker media fix
This commit is contained in:
@@ -199,7 +199,6 @@ const makeGroupsSocket = (config: SocketConfig) => {
|
||||
ev.emit('group-participants.update', { jid, participants: jids, action })
|
||||
return jids
|
||||
},
|
||||
|
||||
/** Query broadcast list info */
|
||||
getBroadcastListInfo: async(jid: string) => {
|
||||
interface WABroadcastListInfo {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BinaryNode from "../BinaryNode";
|
||||
import { Boom } from '@hapi/boom'
|
||||
import { EventEmitter } from 'events'
|
||||
import { Chat, Presence, WAMessageCursor, SocketConfig, WAMessage, WAMessageKey, ParticipantAction, WAMessageProto, WAMessageStatus, WAMessageStubType, GroupMetadata, AnyMessageContent, MiscMessageGenerationOptions, WAFlag, WAMetric, WAUrlInfo, MediaConnInfo, MessageUpdateType, MessageInfo, MessageInfoUpdate, WAMediaUploadFunction, MediaType } from "../Types";
|
||||
import { Chat, Presence, WAMessageCursor, SocketConfig, WAMessage, WAMessageKey, ParticipantAction, WAMessageProto, WAMessageStatus, WAMessageStubType, GroupMetadata, AnyMessageContent, MiscMessageGenerationOptions, WAFlag, WAMetric, WAUrlInfo, MediaConnInfo, MessageUpdateType, MessageInfo, MessageInfoUpdate, WAMediaUploadFunction, MediaType, WAMessageUpdate } from "../Types";
|
||||
import { isGroupID, toNumber, whatsappID, generateWAMessage, decryptMediaMessageBuffer } from "../Utils";
|
||||
import makeChatsSocket from "./chats";
|
||||
import { DEFAULT_ORIGIN, MEDIA_PATH_MAP, WA_DEFAULT_EPHEMERAL } from "../Defaults";
|
||||
@@ -345,6 +345,7 @@ const makeMessagesSocket = (config: SocketConfig) => {
|
||||
// message status updates
|
||||
const onMessageStatusUpdate = ({ data }: BinaryNode) => {
|
||||
if(Array.isArray(data)) {
|
||||
const updates: WAMessageUpdate[] = []
|
||||
for(const { attributes: json } of data) {
|
||||
const key: WAMessageKey = {
|
||||
remoteJid: whatsappID(json.jid),
|
||||
@@ -354,11 +355,12 @@ const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const status = STATUS_MAP[json.type]
|
||||
|
||||
if(status) {
|
||||
ev.emit('messages.update', [ { key, update: { status } } ])
|
||||
updates.push({ key, update: { status } })
|
||||
} else {
|
||||
logger.warn({ data }, 'got unknown status update for message')
|
||||
}
|
||||
}
|
||||
ev.emit('messages.update', updates)
|
||||
}
|
||||
}
|
||||
const onMessageInfoUpdate = ([,attributes]: [string,{[_: string]: any}]) => {
|
||||
|
||||
@@ -143,7 +143,6 @@ export default(
|
||||
logger.debug({ update }, `got update for non-existent message`)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
ev.on('messages.delete', item => {
|
||||
const list = assertMessageList(item.jid)
|
||||
|
||||
@@ -18,6 +18,8 @@ import { MediaType } from '../Types'
|
||||
import { DEFAULT_ORIGIN } from '../Defaults'
|
||||
|
||||
export const hkdfInfoKey = (type: MediaType) => {
|
||||
if(type === 'sticker') type = 'image'
|
||||
|
||||
let hkdfInfo = type[0].toUpperCase() + type.slice(1)
|
||||
return `WhatsApp ${hkdfInfo} Keys`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user