aboutsummaryrefslogtreecommitdiff
path: root/telegram/client.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-07-16 15:19:11 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-07-16 15:19:11 +0300
commit563cb2d624598efdd3819daef00c64079d8a20e1 (patch)
treec19d0d96bc3c68c151d627b1f65091ec081dda67 /telegram/client.go
parente954c73bd2d881bc448b6bb2b3cb3a4ad37d0139 (diff)
Avoid webpage preview updates being sent as message edits
Diffstat (limited to 'telegram/client.go')
-rw-r--r--telegram/client.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/telegram/client.go b/telegram/client.go
index 61d46aa..5cc15a4 100644
--- a/telegram/client.go
+++ b/telegram/client.go
@@ -53,6 +53,7 @@ type Client struct {
Session *persistence.Session
resources map[string]bool
outbox map[string]string
+ editQueue map[ChatMessageId]bool
content *config.TelegramContentConfig
cache *cache.Cache
online bool
@@ -69,6 +70,7 @@ type clientLocks struct {
chatMessageLocks map[int64]*sync.Mutex
resourcesLock sync.Mutex
outboxLock sync.Mutex
+ editQueueLock sync.Mutex
}
// NewClient instantiates a Telegram App
@@ -125,6 +127,7 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component
Session: session,
resources: make(map[string]bool),
outbox: make(map[string]string),
+ editQueue: make(map[ChatMessageId]bool),
content: &conf.Content,
cache: cache.NewCache(),
options: options,