Add support for multi body in message with lang definition.

This commit is contained in:
Chteufleur 2016-11-13 20:25:47 +01:00
parent 0490e0a087
commit 4df4e9cec2
1 changed files with 15 additions and 9 deletions

View File

@ -73,9 +73,10 @@ type Message struct {
To string `xml:"to,attr,omitempty"`
From string `xml:"from,attr,omitempty"`
Subject string `xml:"subject,omitempty"`
Body string `xml:"body,omitempty"`
Body []MessageBody `xml:"body,omitempty"`
Thread string `xml:"thread,omitempty"`
Error *Error `xml:"error"`
Lang string `xml:"xml:lang,attr,omitempty"`
Confir *Confirm `xml:"confirm"` // XEP-0070
@ -86,6 +87,11 @@ type Message struct {
Gone *Gone `xml:"gone"` // XEP-0085
}
type MessageBody struct {
Lang string `xml:"xml:lang,attr,omitempty"`
Value string `xml:",innerxml"`
}
// XMPP <presence/> stanza.
type Presence struct {
XMLName xml.Name `xml:"presence"`