Rest in peace Dolly Patron

This commit is contained in:
2026-08-25 20:17:23 +01:00
parent 2717137270
commit a6e74ec808
52 changed files with 675 additions and 462 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"encoding/xml"
"gosrc.io/xmpp/stanza"
"time"
)
// Implementation of XEP-0203: Delayed Delivery
// https://xmpp.org/extensions/xep-0203.html
type Delayed_Stamp struct {
XMLName xml.Name `xml:"urn:xmpp:delay delay"`
From string `xml:"from,attr"`
Stamp string `xml:"stamp,attr"`
}
func (d *Delayed_Stamp) GetStamp() (*time.Time, error) {
stamp := d.Stamp
time, err := time.Parse(time.RFC3339, stamp)
if err != nil {
return nil, err
}
return &time, nil
}
func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:delay", Local: "delay"}, Delayed_Stamp{})
}