aboutsummaryrefslogtreecommitdiff
path: root/xmpp/gateway/gateway.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/gateway/gateway.go')
-rw-r--r--xmpp/gateway/gateway.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go
index 779c6fe..4edaec4 100644
--- a/xmpp/gateway/gateway.go
+++ b/xmpp/gateway/gateway.go
@@ -88,6 +88,9 @@ var SPNickname = args.NewString()
// SPPhoto is a XEP-0153 hash of avatar in vCard
var SPPhoto = args.NewString()
+// SPResource is an optional resource
+var SPResource = args.NewString()
+
// SPImmed skips queueing
var SPImmed = args.NewBool(args.Default(true))
@@ -95,6 +98,12 @@ func newPresence(bareJid string, to string, args ...args.V) stanza.Presence {
var presenceFrom string
if SPFrom.IsSet(args) {
presenceFrom = SPFrom.Get(args) + "@" + bareJid
+ if SPResource.IsSet(args) {
+ resource := SPResource.Get(args)
+ if resource != "" {
+ presenceFrom += "/" + resource
+ }
+ }
} else {
presenceFrom = bareJid
}