1
0
Fork 0

Convenient method for creating an Iq response.

This commit is contained in:
Matt Goodall 2012-07-18 10:56:23 +01:00
parent 438164a9d9
commit f9302660b0
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,12 @@ func (iq *Iq) PayloadName() (name xml.Name) {
return start.Name return start.Name
} }
// Create a response Iq. The Id is kept, To and From are reversed, Type is set
// to the given value.
func (iq *Iq) Response(type_ string) *Iq {
return &Iq{Id: iq.Id, Type: type_, From: iq.To, To: iq.From}
}
// XMPP <message/> stanza. // XMPP <message/> stanza.
type Message struct { type Message struct {
XMLName xml.Name `xml:"message"` XMLName xml.Name `xml:"message"`