diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-08 20:43:51 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-08 20:43:51 +0300 |
commit | 06104797341533bd96ab2030d110bd843cea5098 (patch) | |
tree | 4187611cd939158e6fd210d35156f41158205577 /telegram/client.go | |
parent | 76364388ad2d7baa0718dff50902eacd4c090edf (diff) |
Attach resource to presences to prevent unwanted behaviour of some clients
Diffstat (limited to 'telegram/client.go')
-rw-r--r-- | telegram/client.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/telegram/client.go b/telegram/client.go index 5220c2d..9a98be7 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -48,6 +48,7 @@ type Client struct { options []client.Option me *client.User + resource string xmpp *xmpp.Component jid string Session *persistence.Session @@ -115,8 +116,14 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component IgnoreFileNames: false, } + resource := conf.Tdlib.Client.DeviceModel + if resource == "" { + resource = "telegabber" + } + return &Client{ parameters: ¶meters, + resource: resource, xmpp: component, jid: jid, Session: session, |