use lastmod to speedup contact updates

This commit is contained in:
Florent de Lamotte 2025-07-16 22:57:51 +02:00
parent 742c498a14
commit 665dea3648
3 changed files with 15 additions and 5 deletions

View file

@ -68,7 +68,11 @@ class MessageReader:
self.contacts[c["public_key"]] = c
elif packet_type_value == PacketType.CONTACT_END.value:
await self.dispatcher.dispatch(Event(EventType.CONTACTS, self.contacts))
lastmod = int.from_bytes(data[1:5], byteorder='little')
attributes = {
"lastmod": lastmod,
}
await self.dispatcher.dispatch(Event(EventType.CONTACTS, self.contacts, attributes))
elif packet_type_value == PacketType.SELF_INFO.value:
self_info = {}