Commit Graph

72 Commits

Author SHA1 Message Date
Matt Goodall 1ab83b491b Add component handshake stanza namespace. 2012-07-12 01:17:27 +01:00
Matt Goodall 7cc19606e1 Oops, fix tail.go for new Stream config. 2012-07-12 01:16:21 +01:00
Matt Goodall e95528641b Combine Stream's Decode and DecodeElement methods. 2012-07-12 00:56:35 +01:00
Matt Goodall f97ed9ea37 Remove element name match test from Stream.Next().
Only one place still used it, so it might as well go.
2012-07-12 00:48:44 +01:00
Matt Goodall 6dfd9e096b Documentation tweaks and additions. 2012-07-12 00:40:55 +01:00
Matt Goodall 20c380ebc6 Add UUID4 func and use it instead of hard-coded <iq/> ids. 2012-07-12 00:38:51 +01:00
Matt Goodall 909d0f5fac Make example code easier to read with a bit of log-and-die trickery. 2012-07-12 00:38:51 +01:00
Matt Goodall 424c06855c Make stanza logging in the Stream optional. 2012-07-12 00:38:51 +01:00
Matt Goodall 2c5fbc7122 Log incoming stanzas before they're unmarshaled.
A couple of bits in stream.go are commented out at the moment. They'll
be back in a moment, once the send/recv logging is optional.
2012-07-11 23:24:32 +01:00
Matt Goodall 318a97947b Read incoming start element explicit part of sending outgoing start element. 2012-07-11 23:24:32 +01:00
Matt Goodall 30441cacf4 Fix typo. 2012-07-11 23:24:26 +01:00
Matt Goodall de92cf1a55 Some JID and XML writer tests. 2012-07-11 15:57:06 +01:00
Matt Goodall 9013ad6a6a Remove extra "has" from func comment. 2012-07-11 15:55:37 +01:00
Matt Goodall 85472a72b4 Ensure all methods that decode a stanza go via the same route. 2012-07-11 15:50:27 +01:00
Matt Goodall 2a11a800da Extract writeXMLStartElement func. 2012-07-11 15:35:52 +01:00
Matt Goodall 32bf10887c Keep filters in ordered list, with most recent at head. 2012-07-10 19:03:28 +01:00
Matt Goodall c31efeffe5 Protect XMPP filters from concurrent access. 2012-07-10 17:25:55 +01:00
Matt Goodall 15a35ce4ff Separate sections of attrs with useful comments. 2012-07-10 17:25:25 +01:00
Matt Goodall cf45380866 Only call with attrs that need to be non-zero. 2012-07-10 17:12:54 +01:00
Matt Goodall c33950f532 Fix EOF's package in overview doc. 2012-07-10 15:18:35 +01:00
Matt Goodall 38b727ed46 Fix client creation example code in overview docs. 2012-07-10 15:11:39 +01:00
Matt Goodall 5ab3a9be80 Extract/improve auth response check - it's common to all mechanisms. 2012-07-10 13:14:46 +01:00
Matt Goodall 6ccf6e41a8 Rename auth struct field. 2012-07-10 13:13:13 +01:00
Matt Goodall 32df77187c Make authentication a little more pluggable. 2012-07-10 12:27:29 +01:00
Matt Goodall 5966340a3a Package overview doc. 2012-07-10 10:45:16 +01:00
Matt Goodall de111bc744 Turn googletalk.go into a generic XMPP message tail tool. 2012-07-10 10:43:00 +01:00
Matt Goodall 2a32fc1e44 Add home server from JID lookup helper. 2012-07-10 10:35:39 +01:00
Matt Goodall 2776e78613 Nicer var name to it's clearer it's an error. 2012-07-10 10:08:49 +01:00
Matt Goodall c64a5bc2fe Add example of Google Talk. 2012-07-09 15:11:25 +01:00
Matt Goodall b752357c8d Remap EOF to ErrUnexpectedEOF now we're checking for end of stream. 2012-07-09 15:04:57 +01:00
Matt Goodall 6b01a7f10c Cleanly detect & signal end of stream, and fix code above. 2012-07-09 15:01:15 +01:00
Matt Goodall 5536f034bd Improve fatal error message. 2012-07-09 14:48:04 +01:00
Matt Goodall 4759e83863 Add <error/> stanza. 2012-07-09 14:47:50 +01:00
Matt Goodall b13d0baad0 Simplify error creation. 2012-07-09 13:27:49 +01:00
Matt Goodall 7a91f5d8ea Send stream's version='1.0' attr. 2012-07-09 02:51:16 +01:00
Matt Goodall e2c05fea94 Send xml PI encoding. Route through Stream.send for logging. 2012-07-09 02:50:43 +01:00
Matt Goodall 56a481ff8e No client config means default config. 2012-07-09 02:49:04 +01:00
Matt Goodall dc447769b2 go fmt 2012-07-09 02:21:18 +01:00
Matt Goodall 6a42d26a31 Log stanzas sent to the XMPP component. 2012-07-09 02:19:10 +01:00
Matt Goodall 3be7cf7b0b Implement server-gererated resource binding. 2012-07-09 02:16:25 +01:00
Matt Goodall 2ab32b0959 Experimental XMPP filter-based API, including <iq/> send/recv helper.
The filter mechanism allows you to route any matching stanza to a custom
channel. The SendRecv(iq) method uses a once-only filter to watch for
a reply.
2012-07-09 02:08:01 +01:00
Matt Goodall ec1eaf94b9 More useful docs for Stream and XMPP. 2012-07-09 00:37:21 +01:00
Matt Goodall 6416a5e1ee Resource binding bugs, so I don't forget. 2012-07-09 00:37:21 +01:00
Matt Goodall c9c8526476 Separate stream creation from XMPP use (client, component, etc).
The address of the server is not necessarily related to the JID, e.g.
DNS SRV lookups, manual configuration, etc. Splitting them up means
there's more control and flexibility over how things are put together.

We can always add convenience funcs later, e.g. something like
DialClient(jid, password), to handle the common case.
2012-07-08 23:33:37 +01:00
Matt Goodall 381c04b8b3 Pad out the standard XMPP stanzas a bit so they're at least useful. 2012-07-08 23:20:15 +01:00
Matt Goodall 5399179d50 Represented SASL message and TLS handshake value as chardata. 2012-07-08 23:01:08 +01:00
Matt Goodall 01cff4b3ba Actually use TLS config passed to method. 2012-07-08 22:52:38 +01:00
Matt Goodall f1c999d623 Move the XMPP-specific part of TLS out of the XML stream. 2012-07-08 22:50:10 +01:00
Matt Goodall 0a11fbb155 Remove debug log. 2012-07-08 22:41:34 +01:00
Matt Goodall b9e29ca2b3 Make the stream's API more explicit, add some docs, improved var names. 2012-07-08 22:40:31 +01:00