21 lines
650 B
Go
21 lines
650 B
Go
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/xml"
|
||
|
|
"gosrc.io/xmpp/stanza"
|
||
|
|
)
|
||
|
|
|
||
|
|
type LinkPreview struct {
|
||
|
|
stanza.MsgExtension
|
||
|
|
XMLName xml.Name `xml:"http://www.w3.org/1999/02/22-rdf-syntax-ns# Description"`
|
||
|
|
About string `xml:"https://ogp.me/ns#,attr"`
|
||
|
|
Title string `xml:"https://ogp.me/ns# title"`
|
||
|
|
Description string `xml:"https://ogp.me/ns# description"`
|
||
|
|
Image string `xml:"https://ogp.me/ns# image"`
|
||
|
|
URL string `xml:"https://ogp.me/ns# url"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "http://www.w3.org/1999/02/22-rdf-syntax-ns#", Local: "Description"}, LinkPreview{})
|
||
|
|
}
|