Default opening tag doesn't allow to implement XEP-0174. In this case
client needs to send specific attributes. As solution user passes
attributes that are sent inside opening tag. Previous variant of this
function is renamed to xmpp_conn_open_stream_default().
The way to pass attributes is not the best one, but it's used to conform
existent interface of xmpp_stanza_get_attributes().
Remove "raw" suffix from functions that work with a raw connection.
This function is similar to xmpp_connect_client(), but doesn't perform
authentication. Instead, it calls user's connection handler immediately
after establishing the connection. Hence, user can implement own
authendication or registration procedures.
Such a "raw" connection can be useful when user interaction is required
(e.g. Data Forms in XEP-0077, OAuth2).
Don't use doxygen comments in strophe.h since functions are documented
in *.c files.
Remove mutex from xmpp_log_t because libstrophe is single-thread
library.
If interface function returns char* the result must be freed with
xmpp_free().
In case of const char* the result must not be changed by user. Also, the
result is valid only during stanza lifetime.
xmpp_conn_set_flags() and xmpp_conn_get_flags() unify interface of
connection configuration.
This interface allows compile-time check of supported features or even
run-time check. Therefore, applications can be built with older
libstrophe which doesn't support some optional flags.
Some other APIs, like xmpp_stanza_to_text, return a point that must be freed by the caller with this API.
Signed-off-by: Jack Moffitt <jack@metajack.im>
(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.