diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-06 16:25:46 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-06 16:25:46 +0300 |
commit | 5a48600b7af0a29e136348f0b96be6a014ced9f9 (patch) | |
tree | 2a43d2d5c8ce60d9d56259e9bbf23bafda95e9b7 /telegram/utils.go | |
parent | 9d84965e8bd22be4ed2acb549f12d43ca43cfc50 (diff) |
The Proper Subscriptions Filter
Diffstat (limited to 'telegram/utils.go')
-rw-r--r-- | telegram/utils.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index 66f217a..d6b112d 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -774,3 +774,23 @@ func (c *Client) DownloadFile(id int32, priority int32, synchronous bool) (*clie Synchronous: synchronous, }) } + +// subscribe to a Telegram ID +func (c *Client) subscribeToID(id int64, chat *client.Chat) { + var args []args.V + args = append(args, gateway.SPFrom(strconv.FormatInt(id, 10))) + args = append(args, gateway.SPType("subscribe")) + + if chat == nil { + chat, _, _ = c.GetContactByID(id, nil) + } + if chat != nil { + args = append(args, gateway.SPNickname(chat.Title)) + } + + gateway.SendPresence( + c.xmpp, + c.jid, + args..., + ) +} |