diff options
author | Gary Kramlich <grim@reaperworld.com> | 2023-03-20 21:22:53 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2023-03-20 21:22:53 -0500 |
commit | e8df893735bca9036f2e03c6f2fc561d85846f8d (patch) | |
tree | ea150196f0a16fa139c4773e6ba68a77268490ee /libpurple/util.c | |
parent | a965b83ba6a3a490e54ba69e9f6bf96c80d776e0 (diff) | |
download | pidgin-e8df893735bca9036f2e03c6f2fc561d85846f8d.tar.gz |
Remove all of the tune api
Testing Done:
Compiled, built `pidgin-pot`, and ran the unit tests.
Reviewed at https://reviews.imfreedom.org/r/2368/
Diffstat (limited to 'libpurple/util.c')
-rw-r--r-- | libpurple/util.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/libpurple/util.c b/libpurple/util.c index c4c7660dad..51801c667d 100644 --- a/libpurple/util.c +++ b/libpurple/util.c @@ -993,81 +993,6 @@ purple_escape_filename(const char *str) return buf; } -void purple_util_set_current_song(const char *title, const char *artist, const char *album) -{ - GListModel *manager_model = NULL; - guint n_items = 0; - - manager_model = purple_account_manager_get_default_as_model(); - n_items = g_list_model_get_n_items(manager_model); - for(guint index = 0; index < n_items; index++) { - PurpleAccount *account = g_list_model_get_item(manager_model, index); - PurplePresence *presence; - PurpleStatus *tune; - - if (!purple_account_get_enabled(account)) { - g_object_unref(account); - continue; - } - - presence = purple_account_get_presence(account); - tune = purple_presence_get_status(presence, "tune"); - if (!tune) { - g_object_unref(account); - continue; - } - if (title) { - 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); - } - - g_object_unref(account); - } -} - -char * -purple_util_format_song_info(const char *title, const char *artist, - const char *album) -{ - GString *string; - char *esc; - - if (!title || !*title) { - return NULL; - } - - esc = g_markup_escape_text(title, -1); - string = g_string_new(""); - g_string_append_printf(string, "%s", esc); - g_free(esc); - - if (artist && *artist) { - esc = g_markup_escape_text(artist, -1); - g_string_append_printf(string, _(" - %s"), esc); - g_free(esc); - } - - if (album && *album) { - esc = g_markup_escape_text(album, -1); - g_string_append_printf(string, _(" (%s)"), esc); - g_free(esc); - } - - return g_string_free(string, FALSE); -} - GValue * purple_value_new(GType type) { |