aboutsummaryrefslogtreecommitdiff
path: root/xmpp
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-01-16 04:35:13 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-01-16 04:35:13 +0300
commitb3b53b6145c4b8e31d134942507c3ce0226182a4 (patch)
tree4f0753727317859504c26dd5bd4f338991db9082 /xmpp
parent68e3581724f04366c114f267b3264075bc635061 (diff)
OOB
Diffstat (limited to 'xmpp')
-rw-r--r--xmpp/gateway/gateway.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go
index d4620e6..f4ec690 100644
--- a/xmpp/gateway/gateway.go
+++ b/xmpp/gateway/gateway.go
@@ -28,6 +28,15 @@ var DirtySessions = false
// SendMessage creates and sends a message stanza
func SendMessage(to string, from string, body string, component *xmpp.Component) {
+ sendMessageWrapper(to, from, body, component, "")
+}
+
+// SendMessageWithOOB creates and sends a message stanza with OOB URL
+func SendMessageWithOOB(to string, from string, body string, component *xmpp.Component, oob string) {
+ sendMessageWrapper(to, from, body, component, oob)
+}
+
+func sendMessageWrapper(to string, from string, body string, component *xmpp.Component, oob string) {
componentJid := Jid.Full()
var logFrom string
@@ -54,6 +63,12 @@ func SendMessage(to string, from string, body string, component *xmpp.Component)
Body: body,
}
+ if oob != "" {
+ message.Extensions = append(message.Extensions, stanza.OOB{
+ URL: oob,
+ })
+ }
+
sendMessage(&message, component)
}