aboutsummaryrefslogtreecommitdiff
path: root/xmpp/component.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-05-26 14:14:38 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-05-26 14:14:38 +0300
commit70841a2bea61728c75f6675bcd3355e8dfdcd087 (patch)
tree2405e12fb7f306a0f64725a5631bfb5d7f509e43 /xmpp/component.go
parentae16fd2a0b48c3659a012accd0269323935dfd14 (diff)
Always send XMPP messages with a resource
Diffstat (limited to 'xmpp/component.go')
-rw-r--r--xmpp/component.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmpp/component.go b/xmpp/component.go
index f5143ea..0f23d50 100644
--- a/xmpp/component.go
+++ b/xmpp/component.go
@@ -45,6 +45,13 @@ func NewComponent(conf config.XMPPConfig, tc config.TelegramConfig) (*xmpp.Strea
if err != nil {
return nil, nil, err
}
+ if gateway.Jid.Resource == "" {
+ if tc.Tdlib.Client.DeviceModel != "" {
+ gateway.Jid.Resource = tc.Tdlib.Client.DeviceModel
+ } else {
+ gateway.Jid.Resource = "telegabber"
+ }
+ }
tgConf = tc