# HG changeset patch # User andrew.victor@mxit.com # Date 1320823098 0 # Node ID 96f3af93ee9877e5df031ed9e1be4c85c9d02e96 # Parent 930820b18a8dc33904e78b269f5c0279f906337b# Parent 08151b40c598674cbf575c5a1764d11a9fb75ba2 merge of '377fab6845c6367df5a06eac7afdc93bb2c62e73' and '8604939c29e01882cf36e5aeac696d6ebd76c48f' diff -r 930820b18a8d -r 96f3af93ee98 ChangeLog.API --- a/ChangeLog.API Wed Nov 02 09:51:48 2011 +0000 +++ b/ChangeLog.API Wed Nov 09 07:18:18 2011 +0000 @@ -4,8 +4,10 @@ libpurple: Added: * pidgin_create_webview + * purple_account_is_disconnecting * purple_account_get_ui_data * purple_account_set_ui_data + * purple_account_register_completed * purple_conv_chat_cb_get_alias * purple_conv_chat_cb_get_flags * purple_conv_chat_cb_is_buddy diff -r 930820b18a8d -r 96f3af93ee98 libpurple/account.c --- a/libpurple/account.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/account.c Wed Nov 09 07:18:18 2011 +0000 @@ -1119,6 +1119,15 @@ } void +purple_account_register_completed(PurpleAccount *account, gboolean succeeded) +{ + g_return_if_fail(account != NULL); + + if (account->registration_cb) + (account->registration_cb)(account, succeeded, account->registration_cb_user_data); +} + +void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data) { g_return_if_fail(account != NULL); @@ -1265,6 +1274,14 @@ account->disconnecting = FALSE; } +gboolean +purple_account_is_disconnecting(const PurpleAccount *account) +{ + g_return_val_if_fail(account != NULL, TRUE); + + return account->disconnecting; +} + void purple_account_notify_added(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, diff -r 930820b18a8d -r 96f3af93ee98 libpurple/account.h --- a/libpurple/account.h Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/account.h Wed Nov 09 07:18:18 2011 +0000 @@ -221,6 +221,15 @@ void purple_account_register(PurpleAccount *account); /** + * Registration of the account was completed. + * Calls the registration call-back set with purple_account_set_register_callback(). + * + * @param account The account being registered. + * @param succeeded Was the account registration successful? + */ +void purple_account_register_completed(PurpleAccount *account, gboolean succeeded); + +/** * Unregisters an account (deleting it from the server). * * @param account The account to unregister. @@ -237,6 +246,15 @@ void purple_account_disconnect(PurpleAccount *account); /** + * Indicates if the account is currently being disconnected. + * + * @param account The account + * + * @return TRUE if the account is being disconnected. + */ +gboolean purple_account_is_disconnecting(const PurpleAccount *account); + +/** * Notifies the user that the account was added to a remote user's * buddy list. * diff -r 930820b18a8d -r 96f3af93ee98 libpurple/plugins/ssl/Makefile.am --- a/libpurple/plugins/ssl/Makefile.am Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/plugins/ssl/Makefile.am Wed Nov 09 07:18:18 2011 +0000 @@ -9,30 +9,15 @@ if PLUGINS -# I'm sorry to report that Automake Conditionals don't support -# if USE_GNUTLS && USE_NSS -# but only support testing a single variable. Hence: - +plugin_LTLIBRARIES = \ + ssl.la if USE_GNUTLS -if USE_NSS -plugin_LTLIBRARIES = \ - ssl.la \ - ssl-gnutls.la \ - ssl-nss.la -else -plugin_LTLIBRARIES = \ - ssl.la \ +plugin_LTLIBRARIES += \ ssl-gnutls.la endif -else if USE_NSS -plugin_LTLIBRARIES = \ - ssl.la \ +plugin_LTLIBRARIES += \ ssl-nss.la -else -plugin_LTLIBRARIES = \ - ssl.la -endif endif ssl_la_SOURCES = ssl.c @@ -56,3 +41,4 @@ ssl_gnutls_la_CFLAGS = $(AM_CPPFLAGS) $(GNUTLS_CFLAGS) ssl_nss_la_CFLAGS = $(AM_CPPFLAGS) $(NSS_CFLAGS) + diff -r 930820b18a8d -r 96f3af93ee98 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/protocols/gg/gg.c Wed Nov 09 07:18:18 2011 +0000 @@ -391,8 +391,8 @@ purple_notify_info(NULL, _("New Gadu-Gadu Account Registered"), _("Registration completed successfully!"), NULL); - if(account->registration_cb) - (account->registration_cb)(account, TRUE, account->registration_cb_user_data); + purple_account_register_completed(account, TRUE); + /* TODO: the currently open Accounts Window will not be updated withthe * new username and etc, we need to somehow have it refresh at this * point @@ -402,8 +402,7 @@ purple_account_disconnect(account); exit_err: - if(account->registration_cb) - (account->registration_cb)(account, FALSE, account->registration_cb_user_data); + purple_account_register_completed(account, FALSE); gg_register_free(h); g_free(email); diff -r 930820b18a8d -r 96f3af93ee98 libpurple/protocols/gg/lib/common.c --- a/libpurple/protocols/gg/lib/common.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/protocols/gg/lib/common.c Wed Nov 09 07:18:18 2011 +0000 @@ -32,9 +32,6 @@ #include #include -#ifndef _WIN32 -# include -#endif #include #include #include diff -r 930820b18a8d -r 96f3af93ee98 libpurple/protocols/irc/cmds.c --- a/libpurple/protocols/irc/cmds.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/protocols/irc/cmds.c Wed Nov 09 07:18:18 2011 +0000 @@ -423,7 +423,7 @@ irc->quitting = TRUE; - if (!irc->account->disconnecting) + if (!purple_account_is_disconnecting(irc->account)) purple_account_set_status(irc->account, "offline", TRUE, NULL); } diff -r 930820b18a8d -r 96f3af93ee98 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed Nov 09 07:18:18 2011 +0000 @@ -440,7 +440,7 @@ * we're disconnecting, don't generate (possibly another) error that * (for some UIs) would mask the first. */ - if (!account->disconnecting) { + if (!purple_account_is_disconnecting(account)) { gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); purple_connection_error(js->gc, @@ -1144,8 +1144,7 @@ if(js->registration) { buf = g_strdup_printf(_("Registration of %s@%s successful"), js->user->node, js->user->domain); - if(account->registration_cb) - (account->registration_cb)(account, TRUE, account->registration_cb_user_data); + purple_account_register_completed(account, TRUE); } else { g_return_if_fail(to != NULL); buf = g_strdup_printf(_("Registration to %s successful"), @@ -1163,8 +1162,7 @@ purple_notify_error(NULL, _("Registration Failed"), _("Registration Failed"), msg); g_free(msg); - if(account->registration_cb) - (account->registration_cb)(account, FALSE, account->registration_cb_user_data); + purple_account_register_completed(account, FALSE); } g_free(to); if(js->registration) @@ -1288,8 +1286,7 @@ { PurpleAccount *account = purple_connection_get_account(cbdata->js->gc); if(account && cbdata->js->registration) { - if(account->registration_cb) - (account->registration_cb)(account, FALSE, account->registration_cb_user_data); + purple_account_register_completed(account, FALSE); jabber_connection_schedule_close(cbdata->js); } g_free(cbdata->who); @@ -1358,8 +1355,7 @@ if(js->registration) { purple_notify_error(NULL, _("Already Registered"), _("Already Registered"), NULL); - if(account->registration_cb) - (account->registration_cb)(account, FALSE, account->registration_cb_user_data); + purple_account_register_completed(account, FALSE); jabber_connection_schedule_close(js); return; } @@ -1380,8 +1376,8 @@ if(js->registration) { js->gc->wants_to_die = TRUE; - if(account->registration_cb) /* succeeded, but we have no login info */ - (account->registration_cb)(account, TRUE, account->registration_cb_user_data); + /* succeeded, but we have no login info */ + purple_account_register_completed(account, TRUE); jabber_connection_schedule_close(js); } return; diff -r 930820b18a8d -r 96f3af93ee98 libpurple/protocols/oscar/flap_connection.c --- a/libpurple/protocols/oscar/flap_connection.c Wed Nov 02 09:51:48 2011 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Wed Nov 09 07:18:18 2011 +0000 @@ -456,7 +456,7 @@ * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then * we should try to request one instead of disconnecting. */ - if (!account->disconnecting && ((od->oscar_connections == NULL) + if (!purple_account_is_disconnecting(account) && ((od->oscar_connections == NULL) || (!flap_connection_getbytype(od, SNAC_FAMILY_LOCATE)))) { /* No more FLAP connections! Sign off this PurpleConnection! */