~samwhited/xmpp

ref: 8a516e9e064619dcb3d84499b66e1562546be918 xmpp/stanza d---------
stanza: create stanzas from any start element

Previously stanzas were unmarshaled from the start element using an
xml.Decoder. This is slow and inefficient, and if the name of the stanza
differs an error will be returned. Implementing manual decoding of the
start element should make things faster (though this has not been
verified) and allows the name of the initial start element to be
disregarded. This will not change the name when the stanza typed value
is marshaled back into an XML stream.

Signed-off-by: Sam Whited <sam@samwhited.com>
all: move stanza wrapping to methods

Previously to wrap a payload in a stanza you would use the functions
WrapIQ, WrapMessage, and WrapPresence. Each of these took their
respective stanza types and a payload.
These have been moved to Wrap methods on the various stanza types that
take a payload to make them easier to use in handlers where you already
have the stanza.
The down side is that these methods now exist on types that embed a
stanza, which may be confusing since the payload will be ignored and
only the stanza will be used.

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: support tokens/stanza conversion

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: add API for easily replying to IQs

Previously the user had to do the repetative task of switching the
to/from attributes and changing the type.  While this isn't a lot of
extra work, it has to be done every time you want to reply to an IQ.
Instead it makes sense to have an easy way to simply reply to the IQ
without making an explicit copy or modifying it and without having to
jump through extra hoops.
stanza: don't require attributes on messages
stanza: fix message and presence type tests
stanza: make the zero value of IQType a "get" IQ
stanza: fix broken IQ type marshaling tests
all: remove unnecessary pointer in WrapIQ
all: remove unnecessary pointer in WrapPresence

And while we're testing the new API, clean up existing tests.
stanza: improve docs to mention stream based API
stanza: flush after MarshalXML
all: bump to new xmlstream and fix flushing
stanza: add Error struct examples

Fixes #26
stanza: improve Error documentation

[ci skip]
stanza: support multiple languages on errors

Also remove the dependency on golang.org/x/text/language.

Fixes #34
stanza: add available presence pseudo-type

Also fix stanza tests
stanza: make attrs on presence optional
xmpp: fix missing error handling
xmpp: use new JID API
all: update copyright message

[ci skip]
Next