This commit is contained in:
Anshu S
2022-02-07 18:20:48 +05:30
committed by GitHub
parent 5ad631b8e7
commit bbea04e5bc

View File

@@ -14,7 +14,7 @@ type LegacyWASocket = ReturnType<typeof makeLegacySocket>
type AnyWASocket = ReturnType<typeof makeMDSocket>
export const waChatKey = (pin: boolean) => ({
key: (c: Chat) => (pin ? (c.pin ? '1' : '0') : '') + (c.archive ? '0' : '1') + c.conversationTimestamp.toString(16).padStart(8, '0') + c.id,
key: (c: Chat) => (pin ? (c.pin ? '1' : '0') : '') + (c.archive ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') :'') + c.id,
compare: (k1: string, k2: string) => k2.localeCompare (k1)
})