--- a/pidgin/gtkaccount.c Sun Dec 12 05:08:39 2021 -0600
+++ b/pidgin/gtkaccount.c Tue Dec 14 01:14:27 2021 -0600
@@ -72,7 +72,6 @@
GtkWidget *modify_button;
GtkWidget *delete_button;
@@ -1241,8 +1240,8 @@
-account_prefs_save(AccountPrefsDialog *dialog)
+account_prefs_save(AccountPrefsDialog *dialog) { + PurpleAccountManager *manager = NULL; PurpleProxyInfo *proxy_info = NULL;
@@ -1252,6 +1251,8 @@
PurpleBuddyIconSpec *icon_spec = NULL;
+ manager = purple_account_manager_get_default(); /* Build the username string. */
username = g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->username_entry)));
@@ -1284,22 +1285,29 @@
if (dialog->account == NULL)
- if (purple_accounts_find(username, dialog->protocol_id) != NULL) {
- purple_debug_warning("gtkaccount", "Trying to add a duplicate %s account (%s).\n",
- dialog->protocol_id, username);
+ account = purple_account_manager_find(manager, username, + if(PURPLE_IS_ACCOUNT(account)) { + purple_debug_warning("gtkaccount", + "Trying to add a duplicate %s account (%s).\n", + dialog->protocol_id, username); purple_notify_error(NULL, NULL, _("Unable to save new account"),
- _("An account already exists with the specified criteria."), NULL);
+ _("An account already exists with the " + "specified criteria."), - if (purple_accounts_get_all() == NULL) {
- /* We're adding our first account. Be polite and show the buddy list */
- PidginBuddyList *blist =
- pidgin_blist_get_default_gtk_blist();
- if (blist != NULL && blist->window != NULL) {
+ if(purple_account_manager_get_all(manager) == NULL) { + /* We're adding our first account. Be polite and show the buddy + PidginBuddyList *blist = pidgin_blist_get_default_gtk_blist(); + if(blist != NULL && blist->window != NULL) { gtk_window_present(GTK_WINDOW(blist->window));
@@ -1475,10 +1483,11 @@
/* If this is a new account, add it to our list */
- purple_accounts_add(account);
+ purple_account_manager_add(manager, account); purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account);
/* If this is a new account, then sign on! */
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_button))) {
@@ -1699,31 +1708,38 @@
signed_on_off_cb(PurpleConnection *gc, gpointer user_data)
+ PurpleAccountManager *manager = NULL; + GList *accounts = NULL; /* Don't need to do anything if the accounts window is not visible */
- if (accounts_window == NULL)
+ if(accounts_window == NULL) { + manager = purple_account_manager_get_default(); + accounts = purple_account_manager_get_all(manager); account = purple_connection_get_account(gc);
model = GTK_TREE_MODEL(accounts_window->model);
- index = g_list_index(purple_accounts_get_all(), account);
- if (gtk_tree_model_iter_nth_child(model, &iter, NULL, index))
+ index = g_list_index(accounts, account); + if(gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) { pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM);
- if ((pixbuf != NULL) && purple_account_is_disconnected(account))
+ if((pixbuf != NULL) && purple_account_is_disconnected(account)) { gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE);
gtk_list_store_set(accounts_window->model, &iter,
g_object_unref(G_OBJECT(pixbuf));
@@ -1766,18 +1782,18 @@
/* If the account was being modified, close the edit window */
- if ((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL)
+ if((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) { account_win_destroy_cb(NULL, NULL, dialog);
- if (accounts_window == NULL)
+ if(accounts_window == NULL) { /* Remove the account from the GtkListStore */
- if (accounts_window_find_account_in_treemodel(&iter, account))
+ if(accounts_window_find_account_in_treemodel(&iter, account)) { gtk_list_store_remove(accounts_window->model, &iter);
- if (purple_accounts_get_all() == NULL)
- gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0);
@@ -1885,11 +1901,13 @@
memcpy(&a, data, sizeof(a));
if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y,
+ PurpleAccountManager *manager = NULL; + GList *accounts = NULL; gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path);
@@ -1898,19 +1916,20 @@
account = g_value_get_pointer(&val);
+ manager = purple_account_manager_get_default(); + accounts = purple_account_manager_get_all(manager); case GTK_TREE_VIEW_DROP_AFTER:
case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
move_account_after(dialog->model, &dialog->drag_iter,
- dest_index = g_list_index(purple_accounts_get_all(),
+ dest_index = g_list_index(accounts, account) + 1; case GTK_TREE_VIEW_DROP_BEFORE:
case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
- dest_index = g_list_index(purple_accounts_get_all(),
+ dest_index = g_list_index(accounts, account); move_account_before(dialog->model, &dialog->drag_iter,
@@ -1920,8 +1939,9 @@
- purple_accounts_reorder(a, dest_index);
+ purple_account_manager_reorder(manager, a, dest_index); @@ -2168,23 +2188,22 @@
-add_account_to_liststore(PurpleAccount *account, gpointer user_data)
+add_account_to_liststore(PurpleAccount *account, gpointer user_data) { GdkPixbuf *global_buddyicon = user_data;
- if (accounts_window == NULL)
+ if(accounts_window == NULL) { gtk_list_store_append(accounts_window->model, &iter);
- gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook),1);
set_account(accounts_window->model, &iter, account, global_buddyicon);
populate_accounts_list(AccountsWindow *dialog) {
+ PurpleAccountManager *manager = NULL; GdkPixbuf *global_buddyicon = NULL;
@@ -2200,14 +2219,13 @@
- l = purple_accounts_get_all();
- g_list_foreach(l, (GFunc)add_account_to_liststore, global_buddyicon);
+ manager = purple_account_manager_get_default(); + purple_account_manager_foreach(manager, add_account_to_liststore, if(global_buddyicon != NULL) {
g_object_unref(G_OBJECT(global_buddyicon));
@@ -2261,42 +2279,13 @@
create_accounts_list(AccountsWindow *dialog)
GtkTargetEntry gte[] = {{"PURPLE_ACCOUNT", GTK_TARGET_SAME_APP, 0}};
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
- accounts_window->notebook = gtk_notebook_new();
- gtk_notebook_set_show_tabs(GTK_NOTEBOOK(accounts_window->notebook), FALSE);
- gtk_notebook_set_show_border(GTK_NOTEBOOK(accounts_window->notebook), FALSE);
- gtk_container_add(GTK_CONTAINER(frame), accounts_window->notebook);
- /* Create a helpful first-time-use label */
- label = gtk_label_new(NULL);
- /* Translators: Please maintain the use of ⇦ or ⇨ to represent the menu hierarchy */
- text = g_strdup_printf(_(
- "<span size='larger' weight='bold'>Welcome to %s!</span>\n\n"
- "You have no IM accounts configured. To start connecting with %s "
- "press the <b>Add...</b> button below and configure your first "
- "account. If you want %s to connect to multiple IM accounts, "
- "press <b>Add...</b> again to configure them all.\n\n"
- "You can come back to this window to add, edit, or remove "
- "accounts from <b>Accounts⇨Manage Accounts</b> in the Buddy "
- "List window"), PIDGIN_NAME, PIDGIN_NAME, PIDGIN_NAME);
- gtk_label_set_markup(GTK_LABEL(label), text);
- gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_widget_show(label);
- gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL);
/* Create the list model. */
dialog->model = gtk_list_store_new(NUM_COLUMNS,
GDK_TYPE_PIXBUF, /* COLUMN_ICON */
@@ -2321,17 +2310,13 @@
g_signal_connect(G_OBJECT(treeview), "button_press_event",
G_CALLBACK(account_treeview_double_click_cb), dialog);
- gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook),
- pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1),
+ gtk_container_add(GTK_CONTAINER(frame), + pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1)); add_columns(treeview, dialog);
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview));
- if (populate_accounts_list(dialog))
- gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 1);
- gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0);
+ populate_accounts_list(dialog); /* Setup DND. I wanna be an orc! */
gtk_tree_view_enable_model_drag_source(
@@ -2351,8 +2336,8 @@
-account_modified_cb(PurpleAccount *account, AccountsWindow *window)
+account_modified_cb(PurpleAccount *account, gpointer data) { + AccountsWindow *window = (AccountsWindow *)data; if (!accounts_window_find_account_in_treemodel(&iter, account))
@@ -2362,11 +2347,13 @@
-global_buddyicon_changed(const char *name, PurplePrefType type,
- gconstpointer value, gpointer window)
+global_buddyicon_changed(const gchar *name, PurplePrefType type, + gconstpointer value, gpointer window) - GList *list = purple_accounts_get_all();
- g_list_foreach(list, (GFunc)account_modified_cb, window);
+ PurpleAccountManager *manager = NULL; + manager = purple_account_manager_get_default(); + purple_account_manager_foreach(manager, account_modified_cb, window); --- a/pidgin/gtkstatusbox.c Sun Dec 12 05:08:39 2021 -0600
+++ b/pidgin/gtkstatusbox.c Tue Dec 14 01:14:27 2021 -0600
@@ -702,12 +702,16 @@
/* This returns NULL if the active accounts don't have identical
* statuses and a token account if they do */
-static PurpleAccount* check_active_accounts_for_identical_statuses(void)
- GList *iter, *active_accts = purple_accounts_get_all_active();
+PurpleAccount *check_active_accounts_for_identical_statuses(void) { + PurpleAccountManager *manager = NULL; + GList *iter, *active_accts = NULL; PurpleAccount *acct1 = NULL;
const char *proto1 = NULL;
+ manager = purple_account_manager_get_default(); + active_accts = purple_account_manager_get_active(manager); acct1 = active_accts->data;
proto1 = purple_account_get_protocol_id(acct1);
@@ -1713,8 +1717,12 @@
/* Manually find the appropriate transient status */
if (status_box->token_status_account) {
+ PurpleAccountManager *manager = NULL; GList *iter = purple_savedstatuses_get_all();
- GList *tmp, *active_accts = purple_accounts_get_all_active();
+ GList *active_accts = NULL; + manager = purple_account_manager_get_default(); + active_accts = purple_account_manager_get_active(manager); for (; iter != NULL; iter = iter->next) {
PurpleSavedStatus *ss = iter->data;
@@ -1727,8 +1735,8 @@
/* this status must have substatuses for all the active accts */
- for(tmp = active_accts; tmp != NULL; tmp = tmp->next) {
- PurpleAccount *acct = tmp->data;
+ while(active_accts != NULL) { + PurpleAccount *acct = active_accts->data; PurpleSavedStatusSub *sub = purple_savedstatus_get_substatus(ss, acct);
const PurpleStatusType *sub_type =
@@ -1739,6 +1747,9 @@
+ active_accts = g_list_delete_link(active_accts, @@ -1756,17 +1767,28 @@
/* If this type+message is unique then create a new transient saved status */
- if (saved_status == NULL)
+ if(saved_status == NULL) { saved_status = purple_savedstatus_new(NULL, primitive);
purple_savedstatus_set_message(saved_status, message);
if (status_box->token_status_account) {
- GList *tmp, *active_accts = purple_accounts_get_all_active();
- for (tmp = active_accts; tmp != NULL; tmp = tmp->next) {
- purple_savedstatus_set_substatus(saved_status,
- (PurpleAccount*) tmp->data, acct_status_type, message);
+ PurpleAccountManager *manager = NULL; + GList *active_accts = NULL; + manager = purple_account_manager_get_default(); + active_accts = purple_account_manager_get_active(manager); + while(active_accts != NULL) { + PurpleAccount *account = NULL; + account = PURPLE_ACCOUNT(active_accts->data); + purple_savedstatus_set_substatus(saved_status, account, + active_accts = g_list_delete_link(active_accts, - g_list_free(active_accts);
@@ -1889,10 +1911,16 @@
* message attribute on any protocol that is enabled,
* or our protocol, if we have account set
- if (status_box->account)
+ if(status_box->account) { accounts = g_list_prepend(accounts, status_box->account);
- accounts = purple_accounts_get_all_active();
+ PurpleAccountManager *manager = NULL; + manager = purple_account_manager_get_default(); + accounts = purple_account_manager_get_active(manager); status_box->editor_visible = FALSE;
for (node = accounts; node != NULL; node = node->next)
--- a/pidgin/pidginmooddialog.c Sun Dec 12 05:08:39 2021 -0600
+++ b/pidgin/pidginmooddialog.c Tue Dec 14 01:14:27 2021 -0600
@@ -95,7 +95,8 @@
update_status_with_mood(account, mood, text);
- GList *accounts = purple_accounts_get_all_active();
+ PurpleAccountManager *manager = purple_account_manager_get_default(); + GList *accounts = purple_account_manager_get_all(manager); for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) {
PurpleAccount *account = (PurpleAccount *) accounts->data;
@@ -130,6 +131,7 @@
pidgin_mood_get_global_moods(void) {
+ PurpleAccountManager *manager = NULL; GHashTable *global_moods = NULL;
GHashTable *mood_counts = NULL;
@@ -141,7 +143,8 @@
global_moods = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
mood_counts = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
- accounts = purple_accounts_get_all_active();
+ manager = purple_account_manager_get_default(); + accounts = purple_account_manager_get_active(manager); for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) {
PurpleAccount *account = (PurpleAccount *) accounts->data;
if (purple_account_is_connected(account)) {
@@ -202,9 +205,12 @@
pidgin_mood_get_global_status(void) {
- GList *accounts = purple_accounts_get_all_active();
+ PurpleAccountManager *manager = NULL; + GList *accounts = NULL; const gchar *found_mood = NULL;
+ manager = purple_account_manager_get_default(); + accounts = purple_account_manager_get_active(manager); for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) {
PurpleAccount *account = (PurpleAccount *) accounts->data;
--- a/pidgin/plugins/unity.c Sun Dec 12 05:08:39 2021 -0600
+++ b/pidgin/plugins/unity.c Tue Dec 14 01:14:27 2021 -0600
@@ -259,24 +259,29 @@
gchar **sections = g_strsplit(id, ":", 0);
PurpleConversation *conv = NULL;
- PurpleConversationManager *manager = NULL;
+ PurpleConversationManager *conversation_manager = NULL; + PurpleAccountManager *account_manager = NULL; char *type = sections[0];
char *cname = sections[1];
char *aname = sections[2];
char *protocol = sections[3];
- manager = purple_conversation_manager_get_default();
+ conversation_manager = purple_conversation_manager_get_default(); - account = purple_accounts_find(aname, protocol);
+ account_manager = purple_account_manager_get_default(); + account = purple_account_manager_find(account_manager, aname, protocol); if (g_strcmp0(type, "im") == 0) {
- conv = purple_conversation_manager_find_im(manager, account, cname);
+ conv = purple_conversation_manager_find_im(conversation_manager, } else if (g_strcmp0(type, "chat") == 0) {
- conv = purple_conversation_manager_find_chat(manager, account, cname);
+ conv = purple_conversation_manager_find_chat(conversation_manager, - conv = purple_conversation_manager_find(manager, account, cname);
+ conv = purple_conversation_manager_find(conversation_manager, @@ -295,17 +300,26 @@
static PurpleSavedStatus *
-create_transient_status(PurpleStatusPrimitive primitive, PurpleStatusType *status_type)
+create_transient_status(PurpleStatusPrimitive primitive, + PurpleStatusType *status_type) PurpleSavedStatus *saved_status = purple_savedstatus_new(NULL, primitive);
if(status_type != NULL) {
- GList *tmp, *active_accts = purple_accounts_get_all_active();
- for (tmp = active_accts; tmp != NULL; tmp = tmp->next) {
- purple_savedstatus_set_substatus(saved_status,
- (PurpleAccount*) tmp->data, status_type, NULL);
+ PurpleAccountManager *manager = NULL; + GList *active_accts = NULL; + manager = purple_account_manager_get_default(); + active_accts = purple_account_manager_get_active(manager); + while(active_accts != NULL) { + PurpleAccount *account = PURPLE_ACCOUNT(active_accts->data); + purple_savedstatus_set_substatus(saved_status, account, + active_accts = g_list_delete_link(active_accts, active_accts); - g_list_free(active_accts);