mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-10-27 23:05:35 -07:00
Add constants (enumlike) for stanza types and simplify packet creation (#62)
* Add constants (enumlike) for stanza types * NewIQ, NewMessage and NewPresence are now initialized with the Attrs struct * Update examples * Do not export backoff code. For now, we do not need to expose backoff in the documentation * Make presence priority an int8
This commit is contained in:
@@ -43,7 +43,7 @@ func handleMessage(s xmpp.Sender, p xmpp.Packet) {
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintf(os.Stdout, "Body = %s - from = %s\n", msg.Body, msg.From)
|
||||
reply := xmpp.Message{PacketAttrs: xmpp.PacketAttrs{To: msg.From}, Body: msg.Body}
|
||||
reply := xmpp.Message{Attrs: xmpp.Attrs{To: msg.From}, Body: msg.Body}
|
||||
_ = s.Send(reply)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user