diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2022-10-05 00:50:12 -0500 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2022-10-05 00:50:12 -0500 |
commit | 6fd215ca0899af3fce37355b69a0447f55427d0c (patch) | |
tree | 7b87a326dec7cb4519209973ce669b2fce767d90 /libpurple/util.c | |
parent | 72d4db0a871d7598db2eee47cc0e17ae6b5bc944 (diff) | |
download | pidgin-6fd215ca0899af3fce37355b69a0447f55427d0c.tar.gz |
Merge purple_status_set_active_with_attrs{,_dict}
Its docs say it should only be called by the account, conversation, and buddy
APIs, and all of those use the `_dict` version, so the other can be dropped,
and we might as well rename it at the same time.
Testing Done:
Compiled and opened demo account, which indirectly call this through buddy statuses.
Reviewed at https://reviews.imfreedom.org/r/1861/
Diffstat (limited to 'libpurple/util.c')
-rw-r--r-- | libpurple/util.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/libpurple/util.c b/libpurple/util.c index f7dac2a7b8..a2bbcbc8b4 100644 --- a/libpurple/util.c +++ b/libpurple/util.c @@ -931,15 +931,6 @@ purple_escape_filename(const char *str) return buf; } -static void -set_status_with_attrs(PurpleStatus *status, ...) -{ - va_list args; - va_start(args, status); - purple_status_set_active_with_attrs(status, TRUE, args); - va_end(args); -} - void purple_util_set_current_song(const char *title, const char *artist, const char *album) { PurpleAccountManager *manager = purple_account_manager_get_default(); @@ -956,11 +947,18 @@ void purple_util_set_current_song(const char *title, const char *artist, const c if (!tune) continue; if (title) { - set_status_with_attrs(tune, - PURPLE_TUNE_TITLE, title, - PURPLE_TUNE_ARTIST, artist, - PURPLE_TUNE_ALBUM, album, - NULL); + GHashTable *attributes = g_hash_table_new(g_str_hash, g_str_equal); + + g_hash_table_insert(attributes, PURPLE_TUNE_TITLE, + (gpointer)title); + g_hash_table_insert(attributes, PURPLE_TUNE_ARTIST, + (gpointer)artist); + g_hash_table_insert(attributes, PURPLE_TUNE_TITLE, + (gpointer)album); + + purple_status_set_active_with_attributes(tune, TRUE, attributes); + + g_hash_table_destroy(attributes); } else { purple_status_set_active(tune, FALSE); } |