From ea004b7f7c11fa0ddf560317fd9d6f9b2869144a Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Mon, 29 Jan 2024 04:28:15 -0500 Subject: Reflect Telegram edits natively by nativeedits option --- telegram/client.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'telegram/client.go') diff --git a/telegram/client.go b/telegram/client.go index 38dff4c..79f27d5 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -45,6 +45,7 @@ type Client struct { DelayedStatusesLock sync.Mutex lastMsgHashes map[int64]uint64 + lastMsgIds map[int64]string msgHashSeed maphash.Seed locks clientLocks @@ -58,6 +59,7 @@ type clientLocks struct { outboxLock sync.Mutex editOutboxLock sync.Mutex lastMsgHashesLock sync.Mutex + lastMsgIdsLock sync.RWMutex authorizerReadLock sync.Mutex authorizerWriteLock sync.Mutex @@ -119,6 +121,7 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component options: options, DelayedStatuses: make(map[int64]*DelayedStatus), lastMsgHashes: make(map[int64]uint64), + lastMsgIds: make(map[int64]string), msgHashSeed: maphash.MakeSeed(), locks: clientLocks{ chatMessageLocks: make(map[int64]*sync.Mutex), -- cgit v1.2.3