diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-07-09 06:52:30 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-07-09 06:52:30 +0300 |
commit | 959dc061ff30ba1cf5c699adc0f7d1d991d7afa5 (patch) | |
tree | c9c0b6c97ec703ad6fbc2f75b250dd9930f2a653 /telegram/client.go | |
parent | 30b3fd16153fab727315f014150d98b367ccd6ad (diff) |
Send carbons for outgoing messages to other resources
Diffstat (limited to 'telegram/client.go')
-rw-r--r-- | telegram/client.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/telegram/client.go b/telegram/client.go index 71d8125..61d46aa 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -52,6 +52,7 @@ type Client struct { jid string Session *persistence.Session resources map[string]bool + outbox map[string]string content *config.TelegramContentConfig cache *cache.Cache online bool @@ -59,13 +60,15 @@ type Client struct { DelayedStatuses map[int64]*DelayedStatus DelayedStatusesLock sync.Mutex - locks clientLocks + locks clientLocks + SendMessageLock sync.Mutex } type clientLocks struct { authorizationReady sync.Mutex chatMessageLocks map[int64]*sync.Mutex resourcesLock sync.Mutex + outboxLock sync.Mutex } // NewClient instantiates a Telegram App @@ -121,6 +124,7 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component jid: jid, Session: session, resources: make(map[string]bool), + outbox: make(map[string]string), content: &conf.Content, cache: cache.NewCache(), options: options, |