--- a/finch/gntaccount.c Mon Nov 07 23:28:31 2022 -0600
+++ b/finch/gntaccount.c Mon Nov 07 23:29:57 2022 -0600
@@ -58,7 +58,6 @@
/* This is necessary to close an edit-dialog when an account is deleted */
@@ -241,10 +240,7 @@
gnt_box_give_focus_to_child(GNT_BOX(accounts.window), accounts.tree);
- if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, register_user) &&
- gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->regserver))) {
- purple_account_register(account);
- } else if (dialog->account == NULL) {
+ if (dialog->account == NULL) { /* This is a new account. Set it to the current status. */
/* Xerox from gtkaccount.c :D */
const PurpleSavedStatus *saved_status;
@@ -477,11 +473,6 @@
g_list_free_full(opts, (GDestroyNotify)purple_account_option_destroy);
- /* Show the registration checkbox only in a new account dialog,
- * and when the selected protocol has the support for it. */
- gnt_widget_set_visible(dialog->regserver, account == NULL &&
- PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER, register_user));
@@ -628,10 +619,6 @@
gnt_box_add_widget(GNT_BOX(window), dialog->remember);
gnt_box_add_widget(GNT_BOX(window), dialog->require_password);
- /* Register checkbox */
- dialog->regserver = gnt_check_box_new(_("Create this account on the server"));
- gnt_box_add_widget(GNT_BOX(window), dialog->regserver);
gnt_box_add_widget(GNT_BOX(window), gnt_line_new(FALSE));
--- a/libpurple/account.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/account.c Mon Nov 07 23:29:57 2022 -0600
@@ -91,9 +91,6 @@
PurplePresence *presence; /* Presence. */
- PurpleAccountRegistrationCb registration_cb;
- void *registration_cb_user_data;
PurpleConnectionErrorInfo *current_error; /* Errors */
PurpleNotification *error_notification;
@@ -105,13 +102,6 @@
- PurpleAccount *account;
/* GObject Property enums */
@@ -179,101 +169,6 @@
-purple_account_register_got_password_cb(GObject *obj, GAsyncResult *res,
- PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj);
- PurpleAccount *account = PURPLE_ACCOUNT(data);
- gchar *password = NULL;
- password = purple_credential_manager_read_password_finish(manager, res,
- /* If we failed to read a password, just log it, as it could not be
- * stored yet, in which case we will just prompt the user later in the
- purple_debug_warning("account", "failed to read password: %s",
- purple_account_real_connect(account, password);
-purple_account_register(PurpleAccount *account)
- PurpleCredentialManager *manager = NULL;
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- purple_debug_info("account", "Registering account %s\n",
- purple_account_get_username(account));
- manager = purple_credential_manager_get_default();
- purple_credential_manager_read_password_async(manager, account, NULL,
- purple_account_register_got_password_cb,
-purple_account_unregister_got_password_cb(GObject *obj, GAsyncResult *res,
- PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj);
- PurpleCallbackBundle *cbb = data;
- PurpleAccountUnregistrationCb cb;
- gchar *password = NULL;
- cb = (PurpleAccountUnregistrationCb)cbb->cb;
- password = purple_credential_manager_read_password_finish(manager, res,
- purple_debug_warning("account", "failed to read password: %s",
- _purple_connection_new_unregister(cbb->account, password, cb, cbb->data);
-struct register_completed_closure
- PurpleAccount *account;
-purple_account_register_completed_cb(gpointer data)
- PurpleAccount *account = NULL;
- struct register_completed_closure *closure = data;
- account = closure->account;
- if (account->registration_cb) {
- (account->registration_cb)(closure->account, closure->succeeded,
- account->registration_cb_user_data);
- g_object_unref(closure->account);
request_password_write_cb(GObject *obj, GAsyncResult *res, gpointer data) {
PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj);
PurpleAccount *account = PURPLE_ACCOUNT(data);
@@ -1158,52 +1053,6 @@
-purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data)
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- account->registration_cb = cb;
- account->registration_cb_user_data = user_data;
-purple_account_register_completed(PurpleAccount *account, gboolean succeeded)
- struct register_completed_closure *closure;
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- closure = g_new0(struct register_completed_closure, 1);
- closure->account = g_object_ref(account);
- closure->succeeded = succeeded;
- g_timeout_add(0, purple_account_register_completed_cb, closure);
-purple_account_unregister(PurpleAccount *account,
- PurpleAccountUnregistrationCb cb, gpointer user_data)
- PurpleCallbackBundle *cbb;
- PurpleCredentialManager *manager = NULL;
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- purple_debug_info("account", "Unregistering account %s\n",
- purple_account_get_username(account));
- cbb = g_new0(PurpleCallbackBundle, 1);
- cbb->account = account;
- cbb->cb = G_CALLBACK(cb);
- manager = purple_credential_manager_get_default();
- purple_credential_manager_read_password_async(manager, account, NULL,
- purple_account_unregister_got_password_cb,
purple_account_disconnect(PurpleAccount *account)
--- a/libpurple/account.h Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/account.h Mon Nov 07 23:29:57 2022 -0600
@@ -34,8 +34,6 @@
typedef struct _PurpleAccount PurpleAccount;
typedef gboolean (*PurpleFilterAccountFunc)(PurpleAccount *account);
-typedef void (*PurpleAccountRegistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
-typedef void (*PurpleAccountUnregistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
@@ -137,47 +135,6 @@
void purple_account_connect(PurpleAccount *account);
- * purple_account_set_register_callback:
- * @account: The account for which this callback should be used
- * @cb: (scope call): The callback
- * @user_data: The user data passed to the callback
- * Sets the callback for successful registration.
-void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data);
- * purple_account_register:
- * @account: The account to register.
- * Registers an account.
-void purple_account_register(PurpleAccount *account);
- * purple_account_register_completed:
- * @account: The account being registered.
- * @succeeded: Was the account registration successful?
- * Registration of the account was completed.
- * Calls the registration call-back set with purple_account_set_register_callback().
-void purple_account_register_completed(PurpleAccount *account, gboolean succeeded);
- * purple_account_unregister:
- * @account: The account to unregister.
- * @cb: (scope call): Optional callback to be called when unregistration is
- * @user_data: user data to pass to the callback
- * Unregisters an account (deleting it from the server).
-void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
* purple_account_disconnect:
* @account: The account to disconnect from.
--- a/libpurple/connection.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/connection.c Mon Nov 07 23:29:57 2022 -0600
@@ -921,61 +921,6 @@
g_object_class_install_properties(obj_class, PROP_LAST, properties);
-_purple_connection_new_unregister(PurpleAccount *account, const char *password,
- PurpleAccountUnregistrationCb cb,
- PurpleProtocol *protocol;
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- protocol = purple_account_get_protocol(account);
- message = g_strdup_printf(_("Missing protocol for %s"),
- purple_account_get_username(account));
- purple_notify_error(NULL, _("Unregistration Error"), message,
- NULL, purple_request_cpar_from_account(account));
- if(!purple_account_is_disconnected(account)) {
- purple_protocol_server_unregister_user(PURPLE_PROTOCOL_SERVER(protocol),
- account, cb, user_data);
- if(((password == NULL) || (*password == '\0')) &&
- !(purple_protocol_get_options(protocol) & OPT_PROTO_NO_PASSWORD) &&
- !(purple_protocol_get_options(protocol) & OPT_PROTO_PASSWORD_OPTIONAL))
- purple_debug_error("connection", "Cannot connect to account %s "
- purple_account_get_username(account));
- PURPLE_TYPE_CONNECTION,
- g_return_if_fail(gc != NULL);
- purple_debug_info("connection", "Unregistering. gc = %p", gc);
- purple_protocol_server_unregister_user(PURPLE_PROTOCOL_SERVER(protocol),
- account, cb, user_data);
purple_connection_connect(PurpleConnection *connection, GError **error) {
PurpleConnectionClass *klass = NULL;
--- a/libpurple/protocols/jabber/auth.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/protocols/jabber/auth.c Mon Nov 07 23:29:57 2022 -0600
@@ -173,11 +173,6 @@
- jabber_register_start(js);
mechs = purple_xmlnode_get_child(packet, "mechanisms");
purple_connection_error(js->gc,
@@ -390,11 +385,6 @@
- if (js->registration) {
- jabber_register_start(js);
* IQ Auth doesn't have support for resource binding, so we need to pick a
* default resource so it will work properly. jabberd14 throws an error and
--- a/libpurple/protocols/jabber/iq.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/protocols/jabber/iq.c Mon Nov 07 23:29:57 2022 -0600
@@ -545,8 +545,6 @@
jabber_iq_register_handler("query", NS_DISCO_ITEMS, jabber_disco_items_parse);
jabber_iq_register_handler("query", NS_LAST_ACTIVITY, jabber_iq_last_parse);
jabber_iq_register_handler("query", NS_OOB_IQ_DATA, jabber_oob_parse);
- jabber_iq_register_handler("query", "jabber:iq:register",
- jabber_register_parse);
jabber_iq_register_handler("query", "jabber:iq:roster",
jabber_iq_register_handler("query", "jabber:iq:version",
--- a/libpurple/protocols/jabber/jabber.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/protocols/jabber/jabber.c Mon Nov 07 23:29:57 2022 -0600
@@ -77,7 +77,6 @@
static gint plugin_ref = 0;
-static void jabber_unregister_account_cb(JabberStream *js);
static void jabber_send_raw(PurpleProtocolServer *protocol_server, JabberStream *js, const gchar *data, gint len);
static void jabber_remove_feature(const gchar *namespace);
static gboolean jabber_initiate_media(PurpleProtocolMedia *media, PurpleAccount *account, const char *who, PurpleMediaSessionType type);
@@ -109,8 +108,6 @@
if (type == JABBER_IQ_RESULT) {
jabber_disco_items_server(js);
- jabber_unregister_account_cb(js);
purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
@@ -270,9 +267,7 @@
- jabber_register_start(js);
- } else if(purple_xmlnode_get_child(packet, "mechanisms")) {
+ if(purple_xmlnode_get_child(packet, "mechanisms")) { jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING);
jabber_auth_start(js, packet);
} else if(purple_xmlnode_get_child(packet, "bind")) {
@@ -1041,486 +1036,6 @@
jabber_stream_connect(js);
-conn_close_cb(gpointer data)
- JabberStream *js = data;
- PurpleAccount *account = purple_connection_get_account(js->gc);
- jabber_parser_free(js);
- purple_account_disconnect(account);
- js->conn_close_timeout = 0;
-jabber_connection_schedule_close(JabberStream *js)
- js->conn_close_timeout = g_timeout_add(0, conn_close_cb, js);
-jabber_registration_result_cb(JabberStream *js, const char *from,
- JabberIqType type, const char *id,
- PurpleXmlNode *packet, gpointer data)
- PurpleAccount *account = purple_connection_get_account(js->gc);
- if (type == JABBER_IQ_RESULT) {
- buf = g_strdup_printf(_("Registration of %s@%s successful"),
- js->user->node, js->user->domain);
- purple_account_register_completed(account, TRUE);
- g_return_if_fail(to != NULL);
- buf = g_strdup_printf(_("Registration to %s successful"),
- purple_notify_info(NULL, _("Registration Successful"),
- _("Registration Successful"), buf,
- purple_request_cpar_from_connection(js->gc));
- char *msg = jabber_parse_error(js, packet, NULL);
- msg = g_strdup(_("Unknown Error"));
- purple_notify_error(NULL, _("Registration Failed"),
- _("Registration Failed"), msg,
- purple_request_cpar_from_connection(js->gc));
- purple_account_register_completed(account, FALSE);
- jabber_connection_schedule_close(js);
-jabber_unregistration_result_cb(JabberStream *js, const char *from,
- JabberIqType type, const char *id,
- PurpleXmlNode *packet, gpointer data)
- /* This function is never called for unregistering our XMPP account from
- * the server, so there should always be a 'to' address. */
- g_return_if_fail(to != NULL);
- if (type == JABBER_IQ_RESULT) {
- buf = g_strdup_printf(_("Registration from %s successfully removed"),
- purple_notify_info(NULL, _("Unregistration Successful"),
- _("Unregistration Successful"), buf,
- purple_request_cpar_from_connection(js->gc));
- char *msg = jabber_parse_error(js, packet, NULL);
- msg = g_strdup(_("Unknown Error"));
- purple_notify_error(NULL, _("Unregistration Failed"),
- _("Unregistration Failed"), msg,
- purple_request_cpar_from_connection(js->gc));
-jabber_register_cb(PurpleKeyValuePair *cbdata, PurpleRequestFields *fields)
- JabberStream *js = cbdata->value;
- PurpleXmlNode *query, *y;
- iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register");
- query = purple_xmlnode_get_child(iq->node, "query");
- purple_xmlnode_set_attrib(iq->node, "to", cbdata->key);
- for(groups = purple_request_fields_get_groups(fields); groups;
- groups = groups->next) {
- for(flds = purple_request_field_group_get_fields(groups->data);
- flds; flds = flds->next) {
- PurpleRequestField *field = flds->data;
- const char *id = purple_request_field_get_id(field);
- if(purple_strequal(id,"unregister")) {
- gboolean value = purple_request_field_bool_get_value(field);
- /* unregister from service. this doesn't include any of the fields, so remove them from the stanza by recreating it
- (there's no "remove child" function for PurpleXmlNode) */
- iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register");
- query = purple_xmlnode_get_child(iq->node, "query");
- purple_xmlnode_set_attrib(iq->node, "to", cbdata->key);
- purple_xmlnode_new_child(query, "remove");
- jabber_iq_set_callback(iq, jabber_unregistration_result_cb, g_strdup(cbdata->key));
- purple_key_value_pair_free(cbdata);
- const char *ids[] = {"username", "password", "name", "email", "nick", "first",
- "last", "address", "city", "state", "zip", "phone", "url", "date",
- const char *value = purple_request_field_string_get_value(field);
- for (i = 0; ids[i]; i++) {
- if (purple_strequal(id, ids[i]))
- y = purple_xmlnode_new_child(query, ids[i]);
- purple_xmlnode_insert_data(y, value, -1);
- if(js->registration && purple_strequal(id, "username")) {
- g_free(js->user->node);
- js->user->node = g_strdup(value);
- if(js->registration && purple_strequal(id, "password")) {
- PurpleCredentialManager *manager = NULL;
- PurpleAccount *account = NULL;
- account = purple_connection_get_account(js->gc);
- manager = purple_credential_manager_get_default();
- purple_credential_manager_write_password_async(manager,
- char *username = g_strdup_printf("%s@%s%s%s", js->user->node, js->user->domain,
- js->user->resource ? "/" : "",
- js->user->resource ? js->user->resource : "");
- purple_account_set_username(purple_connection_get_account(js->gc), username);
- jabber_iq_set_callback(iq, jabber_registration_result_cb, g_strdup(cbdata->key));
- purple_key_value_pair_free(cbdata);
-jabber_register_cancel_cb(PurpleKeyValuePair *cbdata, PurpleRequestFields *fields)
- JabberStream *js = cbdata->value;
- PurpleAccount *account = purple_connection_get_account(js->gc);
- if(account && js->registration) {
- purple_account_register_completed(account, FALSE);
- jabber_connection_schedule_close(js);
- purple_key_value_pair_free(cbdata);
-static void jabber_register_x_data_cb(JabberStream *js, PurpleXmlNode *result, gpointer data)
- iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register");
- query = purple_xmlnode_get_child(iq->node, "query");
- purple_xmlnode_set_attrib(iq->node,"to",to);
- purple_xmlnode_insert_child(query, result);
- jabber_iq_set_callback(iq, jabber_registration_result_cb, to);
-} registration_fields[] = {
- { "email", N_("Email") },
- { "nick", N_("Nickname") },
- { "first", N_("First name") },
- { "last", N_("Last name") },
- { "address", N_("Address") },
- { "city", N_("City") },
- { "state", N_("State") },
- { "zip", N_("Postal code") },
- { "phone", N_("Phone") },
- { "date", N_("Date") },
-void jabber_register_parse(JabberStream *js, const char *from, JabberIqType type,
- const char *id, PurpleXmlNode *query)
- PurpleAccount *account = purple_connection_get_account(js->gc);
- PurpleRequestFields *fields;
- PurpleRequestFieldGroup *group;
- PurpleRequestField *field;
- PurpleXmlNode *x, *y, *node;
- PurpleKeyValuePair *cbdata;
- gboolean registered = FALSE;
- if (type != JABBER_IQ_RESULT)
- /* get rid of the login thingy */
- purple_connection_set_state(js->gc, PURPLE_CONNECTION_STATE_CONNECTED);
- if(purple_xmlnode_get_child(query, "registered")) {
- purple_notify_error(NULL, _("Already Registered"),
- _("Already Registered"), NULL,
- purple_request_cpar_from_connection(js->gc));
- purple_account_register_completed(account, FALSE);
- jabber_connection_schedule_close(js);
- if((x = purple_xmlnode_get_child_with_namespace(query, "x", "jabber:x:data"))) {
- jabber_x_data_request(js, x, jabber_register_x_data_cb, g_strdup(from));
- } else if((x = purple_xmlnode_get_child_with_namespace(query, "x", NS_OOB_X_DATA))) {
- if((url = purple_xmlnode_get_child(x, "url"))) {
- if((href = purple_xmlnode_get_data(url))) {
- purple_notify_uri(NULL, href);
- /* succeeded, but we have no login info */
- purple_account_register_completed(account, TRUE);
- purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
- _("Registration completed successfully. Please reconnect to continue."));
- jabber_connection_schedule_close(js);
- /* as a last resort, use the old jabber:iq:register syntax */
- fields = purple_request_fields_new();
- group = purple_request_field_group_new(NULL);
- purple_request_fields_add_group(fields, group);
- if((node = purple_xmlnode_get_child(query, "username"))) {
- char *data = purple_xmlnode_get_data(node);
- field = purple_request_field_string_new("username", _("Username"), data ? data : js->user->node, FALSE);
- field = purple_request_field_string_new("username", _("Username"), data, FALSE);
- purple_request_field_group_add_field(group, field);
- if((node = purple_xmlnode_get_child(query, "password"))) {
- field = purple_request_field_string_new("password", _("Password"),
- purple_connection_get_password(js->gc), FALSE);
- char *data = purple_xmlnode_get_data(node);
- field = purple_request_field_string_new("password", _("Password"), data, FALSE);
- purple_request_field_string_set_masked(field, TRUE);
- purple_request_field_group_add_field(group, field);
- if((node = purple_xmlnode_get_child(query, "name"))) {
- field = purple_request_field_string_new("name", _("Name"),
- purple_account_get_private_alias(purple_connection_get_account(js->gc)), FALSE);
- char *data = purple_xmlnode_get_data(node);
- field = purple_request_field_string_new("name", _("Name"), data, FALSE);
- purple_request_field_group_add_field(group, field);
- for (i = 0; registration_fields[i].name != NULL; ++i) {
- if ((node = purple_xmlnode_get_child(query, registration_fields[i].name))) {
- char *data = purple_xmlnode_get_data(node);
- field = purple_request_field_string_new(registration_fields[i].name,
- _(registration_fields[i].label),
- purple_request_field_group_add_field(group, field);
- field = purple_request_field_bool_new("unregister", _("Unregister"), FALSE);
- purple_request_field_group_add_field(group, field);
- if((y = purple_xmlnode_get_child(query, "instructions")))
- instructions = purple_xmlnode_get_data(y);
- instructions = g_strdup(_("Please fill out the information below "
- "to change your account registration."));
- instructions = g_strdup(_("Please fill out the information below "
- "to register your new account."));
- cbdata = purple_key_value_pair_new(from, js);
- purple_request_fields(js->gc, _("Register New XMPP Account"),
- _("Register New XMPP Account"), instructions, fields,
- _("Register"), G_CALLBACK(jabber_register_cb),
- _("Cancel"), G_CALLBACK(jabber_register_cancel_cb),
- purple_request_cpar_from_connection(js->gc),
- g_return_if_fail(from != NULL);
- title = registered ? g_strdup_printf(_("Change Account Registration at %s"), from)
- :g_strdup_printf(_("Register New Account at %s"), from);
- purple_request_fields(js->gc, title, title, instructions,
- fields, (registered ? _("Change Registration") :
- _("Register")), G_CALLBACK(jabber_register_cb),
- _("Cancel"), G_CALLBACK(jabber_register_cancel_cb),
- purple_request_cpar_from_connection(js->gc), cbdata);
-void jabber_register_start(JabberStream *js)
- iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:register");
-jabber_register_account(PurpleProtocolServer *protocol_server,
- PurpleAccount *account)
- js = jabber_stream_new(account);
- js->registration = TRUE;
- jabber_stream_connect(js);
-jabber_unregister_account_iq_cb(JabberStream *js, const char *from,
- JabberIqType type, const char *id,
- PurpleXmlNode *packet, gpointer data)
- PurpleAccount *account = purple_connection_get_account(js->gc);
- if (type == JABBER_IQ_ERROR) {
- char *msg = jabber_parse_error(js, packet, NULL);
- purple_notify_error(js->gc, _("Error unregistering account"),
- _("Error unregistering account"), msg,
- purple_request_cpar_from_connection(js->gc));
- if(js->unregistration_cb)
- js->unregistration_cb(account, FALSE, js->unregistration_user_data);
- purple_notify_info(js->gc, _("Account successfully "
- "unregistered"), _("Account successfully unregistered"),
- NULL, purple_request_cpar_from_connection(js->gc));
- if(js->unregistration_cb)
- js->unregistration_cb(account, TRUE, js->unregistration_user_data);
-static void jabber_unregister_account_cb(JabberStream *js) {
- g_return_if_fail(js->unregistration);
- iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register");
- query = purple_xmlnode_get_child_with_namespace(iq->node, "query", "jabber:iq:register");
- purple_xmlnode_new_child(query, "remove");
- purple_xmlnode_set_attrib(iq->node, "to", js->user->domain);
- jabber_iq_set_callback(iq, jabber_unregister_account_iq_cb, NULL);
-jabber_unregister_account(PurpleProtocolServer *protocol_server,
- PurpleAccount *account,
- PurpleAccountUnregistrationCb cb, gpointer user_data)
- PurpleConnection *gc = purple_account_get_connection(account);
- if (purple_connection_get_state(gc) != PURPLE_CONNECTION_STATE_CONNECTED) {
- if (purple_connection_get_state(gc) != PURPLE_CONNECTION_STATE_CONNECTING) {
- jabber_login(PURPLE_PROTOCOL(protocol_server), account);
- js = purple_connection_get_protocol_data(gc);
- js->unregistration = TRUE;
- js->unregistration_cb = cb;
- js->unregistration_user_data = user_data;
- js = purple_connection_get_protocol_data(gc);
- if (js->unregistration) {
- purple_debug_error("jabber", "Unregistration in process; ignoring duplicate request.\n");
- js->unregistration = TRUE;
- js->unregistration_cb = cb;
- js->unregistration_user_data = user_data;
- jabber_unregister_account_cb(js);
/* TODO: As Will pointed out in IRC, after being notified by the core to
* shutdown, we should async. wait for the server to send us the stream
* termination before destroying everything. That seems like it would require
@@ -3961,8 +3476,6 @@
jabber_protocol_server_iface_init(PurpleProtocolServerInterface *server_iface)
- server_iface->register_user = jabber_register_account;
- server_iface->unregister_user = jabber_unregister_account;
server_iface->set_info = jabber_set_info;
server_iface->get_info = jabber_buddy_get_info;
server_iface->set_status = jabber_set_status;
--- a/libpurple/protocols/jabber/jabber.h Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/protocols/jabber/jabber.h Mon Nov 07 23:29:57 2022 -0600
@@ -179,8 +179,6 @@
PurpleQueuedOutputStream *output;
char *initial_avatar_hash;
GSList *pending_avatar_requests;
@@ -206,10 +204,6 @@
- gboolean unregistration;
- PurpleAccountUnregistrationCb unregistration_cb;
- void *unregistration_user_data;
/* Entity Capabilities hash */
@@ -297,10 +291,6 @@
void jabber_stream_set_state(JabberStream *js, JabberStreamState state);
-void jabber_register_parse(JabberStream *js, const char *from,
- JabberIqType type, const char *id, PurpleXmlNode *query);
-void jabber_register_start(JabberStream *js);
char *jabber_get_next_id(JabberStream *js);
/** Parse an error into a human-readable string and optionally a disconnect
--- a/libpurple/purpleprivate.h Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/purpleprivate.h Mon Nov 07 23:29:57 2022 -0600
@@ -83,21 +83,6 @@
_purple_buddy_icons_blist_loaded_cb(void);
- * _purple_connection_new_unregister:
- * @account: The account to unregister
- * @password: The password to use.
- * @cb: Optional callback to be called when unregistration is complete
- * @user_data: user data to pass to the callback
- * Tries to unregister the account on the server. If the account is not
- * connected, also creates a new connection.
- * Note: This function should only be called by purple_account_unregister()
-void _purple_connection_new_unregister(PurpleAccount *account, const char *password,
- PurpleAccountUnregistrationCb cb, void *user_data);
* _purple_connection_wants_to_die:
* @gc: The connection to check
--- a/libpurple/purpleprotocolserver.c Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/purpleprotocolserver.c Mon Nov 07 23:29:57 2022 -0600
@@ -36,38 +36,6 @@
*****************************************************************************/
-purple_protocol_server_register_user(PurpleProtocolServer *protocol_server,
- PurpleAccount *account)
- PurpleProtocolServerInterface *iface = NULL;
- g_return_if_fail(PURPLE_IS_PROTOCOL_SERVER(protocol_server));
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- iface = PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol_server);
- if(iface != NULL && iface->register_user != NULL) {
- iface->register_user(protocol_server, account);
-purple_protocol_server_unregister_user(PurpleProtocolServer *protocol_server,
- PurpleAccount *account,
- PurpleAccountUnregistrationCb cb,
- PurpleProtocolServerInterface *iface = NULL;
- g_return_if_fail(PURPLE_IS_PROTOCOL_SERVER(protocol_server));
- g_return_if_fail(PURPLE_IS_ACCOUNT(account));
- iface = PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol_server);
- if(iface != NULL && iface->unregister_user != NULL) {
- iface->unregister_user(protocol_server, account, cb, data);
purple_protocol_server_set_info(PurpleProtocolServer *protocol_server,
PurpleConnection *connection,
--- a/libpurple/purpleprotocolserver.h Mon Nov 07 23:28:31 2022 -0600
+++ b/libpurple/purpleprotocolserver.h Mon Nov 07 23:29:57 2022 -0600
@@ -54,10 +54,6 @@
* PurpleProtocolServerInterface:
- * @register_user: Register a new user.
- * @unregister_user: Remove the user from the server. The account can either be
- * connected or disconnected. After the removal is finished,
- * the connection will stay open and has to be closed!
* @set_info: Sets the user's profile.
* @get_info: Should arrange for purple_notify_userinfo() to be called with the
* requested user's profile.
@@ -93,9 +89,6 @@
- void (*register_user)(PurpleProtocolServer *protocol_server, PurpleAccount *account);
- void (*unregister_user)(PurpleProtocolServer *protocol_server, PurpleAccount *account, PurpleAccountUnregistrationCb cb, gpointer data);
void (*set_info)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, const gchar *info);
void (*get_info)(PurpleProtocolServer *protocol_server, PurpleConnection *connection, const gchar *who);
@@ -129,32 +122,6 @@
- * purple_protocol_server_register_user:
- * @protocol_server: The #PurpleProtocolServer instance.
- * @account: The #PurpleAccount to register.
- * Tell @protocol_server to register the new account described by @account.
-void purple_protocol_server_register_user(PurpleProtocolServer *protocol_server, PurpleAccount *account);
- * purple_protocol_server_unregister_user:
- * @protocol_server: The #PurpleProtocolServer instance.
- * @account: The #PurpleAccount instance.
- * @cb: (scope call): A PurpleAccountUnregistrationCb function.
- * @data: User data to pass to @cb.
- * Unregisters @account with @protocol_server. The account can either be
- * connected or disconnected. After the removal is finished, the connection
- * will stay open and has to be closed.
-void purple_protocol_server_unregister_user(PurpleProtocolServer *protocol_server, PurpleAccount *account, PurpleAccountUnregistrationCb cb, gpointer data);
* purple_protocol_server_set_info:
* @protocol_server: The #PurpleProtocolServer instance.
* @connection: The #PurpleConnection instance.