Format code, remove use of Mellium JID parser, and add indicator for messages originating from WebXDC apps

This commit is contained in:
2026-02-14 22:38:32 +00:00
parent 713cb24508
commit 29ef37e237
3 changed files with 60 additions and 10 deletions

21
xmpp-webxdc.go Normal file
View 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{})
}