# HG changeset patch # User Daniel Atallah # Date 1189728107 0 # Node ID 7baa2bc642265237e9dba071c54faaebd71007fd # Parent 6e93a79b2ae569bedb2654a61d97526649034ddd Cleanup the SASL init and add error checking. diff -r 6e93a79b2ae5 -r 7baa2bc64226 libpurple/protocols/jabber/libxmpp.c --- a/libpurple/protocols/jabber/libxmpp.c Thu Sep 13 21:34:55 2007 +0000 +++ b/libpurple/protocols/jabber/libxmpp.c Fri Sep 14 00:01:47 2007 +0000 @@ -28,6 +28,7 @@ #include "internal.h" #include "accountopt.h" +#include "debug.h" #include "version.h" #include "iq.h" @@ -45,14 +46,11 @@ static PurplePluginProtocolInfo prpl_info = { + OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_MAIL_CHECK | #ifdef HAVE_CYRUS_SASL - OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | - OPT_PROTO_MAIL_CHECK | OPT_PROTO_PASSWORD_OPTIONAL | + OPT_PROTO_PASSWORD_OPTIONAL | +#endif OPT_PROTO_SLASH_COMMANDS_NATIVE, -#else - OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_MAIL_CHECK | - OPT_PROTO_SLASH_COMMANDS_NATIVE, -#endif NULL, /* user_splits */ NULL, /* protocol_options */ {"png", 32, 32, 96, 96, 8191, PURPLE_ICON_SCALE_SEND | PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ @@ -194,6 +192,9 @@ static void init_plugin(PurplePlugin *plugin) { +#ifdef HAVE_CYRUS_SASL + int ret; +#endif PurpleAccountUserSplit *split; PurpleAccountOption *option; @@ -236,7 +237,9 @@ /* XXX - If any other plugin wants SASL this won't be good ... */ #ifdef HAVE_CYRUS_SASL - sasl_client_init(NULL); + if ((ret = sasl_client_init(NULL)) != SASL_OK) { + purple_debug_error("xmpp", "Error (%d) initializing SASL.\n", ret); + } #endif jabber_register_commands();