refactor!: use proto.Conversation's own chat mutation fields instead of baileys added

This commit is contained in:
Adhiraj Singh
2022-09-29 11:06:09 +05:30
parent bb983cd30d
commit e08dd10198
4 changed files with 7 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ import makeOrderedDictionary from './make-ordered-dictionary'
type WASocket = ReturnType<typeof makeMDSocket>
export const waChatKey = (pin: boolean) => ({
key: (c: Chat) => (pin ? (c.pin ? '1' : '0') : '') + (c.archive ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') : '') + c.id,
key: (c: Chat) => (pin ? (c.pinned ? '1' : '0') : '') + (c.archived ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') : '') + c.id,
compare: (k1: string, k2: string) => k2.localeCompare (k1)
})