# # old_revision [8f765c8b1620e8ac488e2be4e987153c51ba2f0a] # # patch "libpurple/account.c" # from [23669c4059e134b4cbc15deb63291ec503e46618] # to [843cccef3abe1153399e4d436ebeb2d2e6c6a2f4] # # patch "libpurple/status.c" # from [a0e82882e37ae83691ee52bc46682db953f7cf96] # to [2eb5205f72998efd11a953a145f45b10fcf1556a] # ============================================================ --- libpurple/account.c 23669c4059e134b4cbc15deb63291ec503e46618 +++ libpurple/account.c 843cccef3abe1153399e4d436ebeb2d2e6c6a2f4 @@ -66,7 +66,20 @@ static PurpleAccountUiOps *account_ui_op } PurpleAccountRequestInfo; static PurpleAccountUiOps *account_ui_ops = NULL; +static PurpleAccountUiOps default_account_ui_ops = +{ + NULL, /* notify_added */ + NULL, /* status_changed */ + NULL, /* request_add */ + NULL, /* request_authorize */ + NULL, /* close_account_request */ + NULL, /* purple_reserved1 */ + NULL, /* purple_reserved2 */ + NULL, /* purple_reserved3 */ + NULL /* purple_reserved4 */ +}; + static GList *accounts = NULL; static guint save_timer = 0; static gboolean accounts_loaded = FALSE; @@ -1077,7 +1090,7 @@ purple_account_notify_added(PurpleAccoun ui_ops = purple_accounts_get_ui_ops(); - if (ui_ops != NULL && ui_ops->notify_added != NULL) + if (ui_ops->notify_added != NULL) ui_ops->notify_added(account, remote_user, id, alias, message); } @@ -1093,7 +1106,7 @@ purple_account_request_add(PurpleAccount ui_ops = purple_accounts_get_ui_ops(); - if (ui_ops != NULL && ui_ops->request_add != NULL) + if (ui_ops->request_add != NULL) ui_ops->request_add(account, remote_user, id, alias, message); } @@ -1104,7 +1117,7 @@ purple_account_request_close_info(Purple ops = purple_accounts_get_ui_ops(); - if (ops != NULL && ops->close_account_request != NULL) + if (ops->close_account_request != NULL) ops->close_account_request(info->ui_handle); g_free(info); @@ -1161,7 +1174,7 @@ purple_account_request_authorization(Pur ui_ops = purple_accounts_get_ui_ops(); - if (ui_ops != NULL && ui_ops->request_authorize != NULL) { + if (ui_ops->request_authorize != NULL) { info = g_new0(PurpleAccountRequestInfo, 1); info->type = PURPLE_ACCOUNT_REQUEST_AUTHORIZATION; info->account = account; @@ -2377,7 +2390,10 @@ purple_accounts_get_ui_ops(void) PurpleAccountUiOps * purple_accounts_get_ui_ops(void) { - return account_ui_ops; + if (account_ui_ops != NULL) + return account_ui_ops; + else + return &default_account_ui_ops; } void * ============================================================ --- libpurple/status.c a0e82882e37ae83691ee52bc46682db953f7cf96 +++ libpurple/status.c 2eb5205f72998efd11a953a145f45b10fcf1556a @@ -650,7 +650,7 @@ notify_status_update(PurplePresence *pre if (purple_account_get_enabled(account, purple_core_get_ui())) purple_prpl_change_account_status(account, old_status, new_status); - if (ops != NULL && ops->status_changed != NULL) + if (ops->status_changed != NULL) { ops->status_changed(account, new_status); }