From 2af95210363bc495e88af656fcab27d0e8c51524 Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Tue, 11 Jun 2019 09:20:33 +0200 Subject: [PATCH] Add support for detecting ProcessOne extensions --- stream.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/stream.go b/stream.go index b23ba69..d25ce58 100644 --- a/stream.go +++ b/stream.go @@ -18,7 +18,11 @@ type StreamFeatures struct { Bind BindBind Session sessionSession StreamManagement streamManagement - Any []xml.Name `xml:",any"` + // ProcessOne Stream Features + P1Push p1Push + P1Rebind p1Rebind + p1Ack p1Ack + Any []xml.Name `xml:",any"` } func (StreamFeatures) Name() string { @@ -118,6 +122,24 @@ func (sf *StreamFeatures) DoesStreamManagement() (isSupported bool) { return false } +// P1 extensions +// Reference: https://docs.ejabberd.im/developer/mobile/core-features/ + +// p1:push support +type p1Push struct { + XMLName xml.Name `xml:"p1:push push"` +} + +// p1:rebind suppor +type p1Rebind struct { + XMLName xml.Name `xml:"p1:rebind rebind"` +} + +// p1:ack support +type p1Ack struct { + XMLName xml.Name `xml:"p1:ack ack"` +} + // ============================================================================ // StreamError Packet