~samwhited/xmpp

ref: 8a516e9e064619dcb3d84499b66e1562546be918 xmpp/echobot_example_test.go -rw-r--r-- 2.5 KiB
xmpp: make STARTTLS always required

TLS (or at the time, SSL) may have been an optional feature in the past,
but it's not anymore. These days it's far more likely that a server will
always want to require TLS in some form, so giving the user the ability
to turn it off just means we're giving users who won't understand the
consequences of their actions a knob to twiddle. In the very rare case
that a user actually *does* need STARTTLS to be an optional stream
feature, I don't think it's something we should support. For this rare
use case, they'll have to take the maintenance burden on themselves by
copy/pasting the StartTLS feature code and tweaking it for their needs.

Fixes #50

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>
xmpp: use struct based encoding for echobot test

The echobot test shows up as an example in documentation, we don't want
to encourage use of the token reader API except as a lower level
mechanism for creating custom encoders and in more complex projects
where efficiency is important.
all: allow encoding structs from within handlers
xmpp: fix possible deadlock in echobot example
Revert "all: pass Session directly to handler"

This reverts commit 7e76defde884af7cd63b3d6bb7065694db076b8f.
all: add new API to make reading tokens safer
all: pass Session directly to handler
all: add and use new SendIQ API
all: remove unnecessary pointer in WrapPresence

And while we're testing the new API, clean up existing tests.
xmpp: clarify error message in example test
xmpp: update docs to mention Send/SendElement
Revert "all: new session XML read/write API"

This reverts commit 5265955b9c79963ea0c1b9f392db0e56b6a242a8.
all: new session XML read/write API
xmpp: remove lang from session creation functions

Since the lang is rarely actually used and we have an advanced
configuration now (by manually creating the Negotiator with
NewNegotiator) there's not much point to having it on the simpler
dialer/session negotiation functions. This is a breaking change.
xmpp: add missing copyright statement

[ci skip]
xmpp: add example echobot
Next