Also prune the build spec for the examples. -Iexpat/lib will have to be
added again if we ever use expat in the example clients directly, but
for now it's unnecessary.
support in and out. It's easier for the build system if we do this
with #ifdef's but conditional compilation is easier while we're
playing around.
Also rename a function.
This adds a tls_t that looks a bit like a socket, but can turn
on and off tls. The idea would be to plug this into the xmpp_conn_t
and use it iff the connection is in TLS mode.
Having debugging on by default in the example seems to help
people trying out the library, and with the default_logger()
call it's not too much extra complication.
We should also write an example/complex.c that exercises
all the callback options, a custom allocator and so on.
(a filtered version of) the default logger which we implemented in
the library but was no longer accessible. This makes it much easier
for the caller to turn logging on by just passing this default
log handler callback pointer into xmpp_ctx_new() instead of having
to always implement boilerplate.
Another option would have been xmpp_get_default_log_level(ctx, level)
to change the filter level of the build in logger, which is installed
if you pass NULL to xmpp_ctx_new(). In this method the logger would
filter everything by default.
Defining static data in the header causes warnings on Apple gcc, and in general
this should be the client's responsibility. The names are obvious from the
log_level enum, which is public, and it's only one line of boilerplate to
copy in implementing a custom logging function.
now derives the domain from the jid.
Is it reasonable to just remove the 'domain' (more properly server) argument directly?
The library should always handle this and I can't think why you'd want to override unless
maybe if you have a proxy.
we did not proceed with legacy authentication. The second bug was that
if no resource was specified, legacy authentication must fail, and this
condition was not being detected.
C-style callbacks. Note that this requires the memory callbacks to
have a userdata pointer (so that we can pass the class instance). Also,
the Context class has to be passed into the constructors for Connection and
Stanza.