/soc/2015/akronix/master: 70f65081cd05: Added account-status-cha...
Abel 'Akronix' Serrano Juste
akronix5 at gmail.com
Thu Jul 2 17:03:52 EDT 2015
Changeset: 70f65081cd05fdab067df2f98a4f86873c4f8947
Author: Abel 'Akronix' Serrano Juste <akronix5 at gmail.com>
Date: 2015-07-02 23:03 +0200
Branch: release-2.x.y
URL: https://hg.pidgin.im/soc/2015/akronix/master/rev/70f65081cd05
Description:
Added account-status-changing signal to libpurple.
Also, removed PurplePrefsUiOps.
diffstat:
libpurple/account.c | 23 ++++++++++++++++-------
libpurple/prpl.c | 3 +++
2 files changed, 19 insertions(+), 7 deletions(-)
diffs (79 lines):
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -2048,9 +2048,9 @@ purple_account_set_int(PurpleAccount *ac
setting->value.integer = value;
g_hash_table_insert(account->settings, g_strdup(name), setting);
-
+
ui_ops = purple_accounts_get_ui_ops();
-
+
if (ui_ops != NULL && ui_ops->set_int != NULL)
ui_ops->set_int(account, name, value);
@@ -2073,9 +2073,9 @@ purple_account_set_string(PurpleAccount
setting->value.string = g_strdup(value);
g_hash_table_insert(account->settings, g_strdup(name), setting);
-
+
ui_ops = purple_accounts_get_ui_ops();
-
+
if (ui_ops != NULL && ui_ops->set_string != NULL)
ui_ops->set_string(account, name, value);
@@ -2099,7 +2099,7 @@ purple_account_set_bool(PurpleAccount *a
g_hash_table_insert(account->settings, g_strdup(name), setting);
ui_ops = purple_accounts_get_ui_ops();
-
+
if (ui_ops != NULL && ui_ops->set_bool != NULL)
ui_ops->set_bool(account, name, value);
@@ -2485,11 +2485,11 @@ purple_account_get_string(const PurpleAc
return default_value;
g_return_val_if_fail(setting->type == PURPLE_PREF_STRING, default_value);
-
+
value = setting->value.string;
if (value == NULL || !*value)
return default_value;
-
+
return value;
}
@@ -3231,6 +3231,15 @@ purple_accounts_init(void)
purple_marshal_VOID__POINTER, NULL, 1,
purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_ACCOUNT));
+ purple_signal_register(handle, "account-status-changing",
+ purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
+ purple_value_new(PURPLE_TYPE_SUBTYPE,
+ PURPLE_SUBTYPE_ACCOUNT),
+ purple_value_new(PURPLE_TYPE_SUBTYPE,
+ PURPLE_SUBTYPE_STATUS),
+ purple_value_new(PURPLE_TYPE_SUBTYPE,
+ PURPLE_SUBTYPE_STATUS));
+
purple_signal_register(handle, "account-status-changed",
purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
purple_value_new(PURPLE_TYPE_SUBTYPE,
diff --git a/libpurple/prpl.c b/libpurple/prpl.c
--- a/libpurple/prpl.c
+++ b/libpurple/prpl.c
@@ -382,6 +382,9 @@ purple_prpl_change_account_status(Purple
g_return_if_fail(new_status != NULL);
g_return_if_fail(!purple_status_is_exclusive(new_status) || old_status != NULL);
+ purple_signal_emit(purple_accounts_get_handle(), "account-status-changing",
+ account, old_status, new_status);
+
do_prpl_change_account_status(account, old_status, new_status);
purple_signal_emit(purple_accounts_get_handle(), "account-status-changed",
More information about the Commits
mailing list