Format code, remove use of Mellium JID parser, and add indicator for messages originating from WebXDC apps
This commit is contained in:
21
xmpp-webxdc.go
Normal file
21
xmpp-webxdc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
// Implementation of XEP-0491: WebXDC
|
||||
// https://xmpp.org/extensions/xep-0491.html
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"gosrc.io/xmpp/stanza"
|
||||
)
|
||||
|
||||
type XDCEl struct {
|
||||
stanza.MsgExtension
|
||||
XMLName xml.Name `xml:"urn:xmpp:webxdc:0 x"`
|
||||
Document string `xml:"document"`
|
||||
Summary string `xml:"summary"`
|
||||
Payload string `xml:"urn:xmpp:json:0 json"` // TODO: Independent JSOn container type (XEP-0335)
|
||||
}
|
||||
|
||||
func init() {
|
||||
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:webxdc:0", Local: "x"}, XDCEl{})
|
||||
}
|
||||
Reference in New Issue
Block a user