aboutsummaryrefslogtreecommitdiff
path: root/xmpp/gateway
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-28 17:16:57 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-08-28 17:16:57 +0300
commit20994e29953dfc9c238f69d919912e0c26e36b97 (patch)
treec078032c172c2e49ea89ba35f2e0367de0da29ee /xmpp/gateway
parent8ba7596ab5b9cd731fb507f60da51c6acf1ef27f (diff)
In-Band Registration (XEP-0077)dev
Diffstat (limited to 'xmpp/gateway')
-rw-r--r--xmpp/gateway/gateway.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go
index 7a2500e..dfe2ebf 100644
--- a/xmpp/gateway/gateway.go
+++ b/xmpp/gateway/gateway.go
@@ -360,6 +360,12 @@ func ResumableSend(component *xmpp.Component, packet stanza.Packet) error {
return err
}
+// SubscribeToTransport ensures a two-way subscription to the transport
+func SubscribeToTransport(component *xmpp.Component, jid string) {
+ SendPresence(component, jid, SPType("subscribe"))
+ SendPresence(component, jid, SPType("subscribed"))
+}
+
// SplitJID tokenizes a JID string to bare JID and resource
func SplitJID(from string) (string, string, bool) {
fromJid, err := stanza.NewJid(from)