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

@ -67,15 +67,16 @@ func (iq *Iq) Response(type_ string) *Iq {
// XMPP <message/> stanza.
type Message struct {
XMLName xml.Name `xml:"message"`
Id string `xml:"id,attr,omitempty"`
Type string `xml:"type,attr,omitempty"`
To string `xml:"to,attr,omitempty"`
From string `xml:"from,attr,omitempty"`
Subject string `xml:"subject,omitempty"`
Body string `xml:"body,omitempty"`
Thread string `xml:"thread,omitempty"`
Error *Error `xml:"error"`
XMLName xml.Name `xml:"message"`
Id string `xml:"id,attr,omitempty"`
Type string `xml:"type,attr,omitempty"`
To string `xml:"to,attr,omitempty"`
From string `xml:"from,attr,omitempty"`
Subject string `xml:"subject,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"`