diff options
Diffstat (limited to 'xmpp')
-rw-r--r-- | xmpp/gateway/gateway.go | 15 |
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) } |