mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor!: cleaner message history sync
This is a breaking change, 1. three events (chats.set, contacts.set, messages.set) are now just one `messaging-history.set` event 2. no need to debounce for app state sync 3. added a new "conditional" chat update to allow for correct app state sync despite not having the chat available on hand
This commit is contained in:
@@ -366,4 +366,14 @@ export const getCodeFromWSError = (error: Error) => {
|
||||
*/
|
||||
export const isWABusinessPlatform = (platform: string) => {
|
||||
return platform === 'smbi' || platform === 'smba'
|
||||
}
|
||||
|
||||
export function trimUndefineds(obj: any) {
|
||||
for(const key in obj) {
|
||||
if(typeof obj[key] === 'undefined') {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
Reference in New Issue
Block a user