pidgin/pidgin

Remove all of the tune api

13 months ago, Gary Kramlich
cd96db566218
Parents b0c31c877bde
Children 3c481d9cc840
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/
--- a/ChangeLog.API Mon Mar 20 21:14:42 2023 -0500
+++ b/ChangeLog.API Mon Mar 20 21:22:53 2023 -0500
@@ -837,6 +837,7 @@
* purple_time_build. Use g_date_time_new* instead.
* purple_time_format. Use g_date_time_format instead.
* purple_timeout_*. Use g_timeout_* or g_idle_* instead.
+ * purple_tune and all corresponding apis.
* purple_txt_cancel
* purple_txt_resolve_account
* PurpleType, use GType instead.
--- a/libpurple/protocols/jabber/jabber.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/jabber.c Mon Mar 20 21:22:53 2023 -0500
@@ -863,7 +863,6 @@
js->chats = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, (GDestroyNotify)jabber_chat_free);
js->next_id = g_random_int();
- js->old_length = 0;
js->keepalive_timeout = 0;
js->max_inactivity = DEFAULT_INACTIVITY_TIME;
/* Set the default protocol version to 1.0. Overridden in parser.c. */
@@ -1057,11 +1056,6 @@
g_free(js->certificate_CN);
g_free(js->old_msg);
g_free(js->old_avatarhash);
- g_free(js->old_artist);
- g_free(js->old_title);
- g_free(js->old_source);
- g_free(js->old_uri);
- g_free(js->old_track);
if (js->keepalive_timeout != 0)
g_source_remove(js->keepalive_timeout);
@@ -1582,7 +1576,6 @@
if(jb) {
JabberBuddyResource *jbr = NULL;
- PurplePresence *presence = purple_buddy_get_presence(b);
const char *sub;
GList *l;
gboolean multiple_resources =
@@ -1605,18 +1598,6 @@
}
if (full) {
- if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
- PurpleStatus *tune = purple_presence_get_status(presence, "tune");
- const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
- const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
- const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
- char *playing = purple_util_format_song_info(title, artist, album);
- if (playing) {
- purple_notify_user_info_add_pair_html(user_info, _("Now Listening"), playing);
- g_free(playing);
- }
- }
-
if(jb->subscription & JABBER_SUB_FROM) {
if(jb->subscription & JABBER_SUB_TO)
sub = _("Both");
@@ -1731,20 +1712,6 @@
NULL);
types = g_list_prepend(types, type);
- type = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE,
- "tune", NULL, FALSE, TRUE, TRUE,
- PURPLE_TUNE_ARTIST, _("Tune Artist"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_TITLE, _("Tune Title"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_ALBUM, _("Tune Album"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_GENRE, _("Tune Genre"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_COMMENT, _("Tune Comment"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_TRACK, _("Tune Track"), purple_value_new(G_TYPE_STRING),
- PURPLE_TUNE_TIME, _("Tune Time"), purple_value_new(G_TYPE_INT),
- PURPLE_TUNE_YEAR, _("Tune Year"), purple_value_new(G_TYPE_INT),
- PURPLE_TUNE_URL, _("Tune URL"), purple_value_new(G_TYPE_STRING),
- NULL);
- types = g_list_prepend(types, type);
-
return g_list_reverse(types);
}
--- a/libpurple/protocols/jabber/jabber.h Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/jabber.h Mon Mar 20 21:22:53 2023 -0500
@@ -209,14 +209,6 @@
int old_priority;
char *old_avatarhash;
- /* same for user tune */
- char *old_artist;
- char *old_title;
- char *old_source;
- char *old_uri;
- int old_length;
- char *old_track;
-
char *certificate_CN;
/* A purple timeout tag for the keepalive */
--- a/libpurple/protocols/jabber/meson.build Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/meson.build Mon Mar 20 21:22:53 2023 -0500
@@ -68,8 +68,6 @@
'useravatar.h',
'usernick.c',
'usernick.h',
- 'usertune.c',
- 'usertune.h',
'xdata.c',
'xdata.h',
'xmpp.c',
--- a/libpurple/protocols/jabber/pep.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/pep.c Mon Mar 20 21:22:53 2023 -0500
@@ -28,7 +28,6 @@
#include <string.h>
#include "useravatar.h"
#include "usernick.h"
-#include "usertune.h"
static GHashTable *pep_handlers = NULL;
@@ -38,7 +37,6 @@
/* register PEP handlers */
jabber_avatar_init();
- jabber_tune_init();
jabber_nick_init();
}
}
--- a/libpurple/protocols/jabber/presence.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/presence.c Mon Mar 20 21:22:53 2023 -0500
@@ -31,8 +31,6 @@
#include "jutil.h"
#include "adhoccommands.h"
-#include "usertune.h"
-
static GHashTable *presence_handlers = NULL;
static const struct {
@@ -178,11 +176,9 @@
char *stripped = NULL;
JabberBuddyState state;
int priority;
- const char *artist = NULL, *title = NULL, *source = NULL, *uri = NULL, *track = NULL;
- int length = -1;
gboolean allowBuzz;
PurplePresence *p;
- PurpleStatus *status, *tune;
+ PurpleStatus *status;
account = purple_connection_get_account(js->gc);
p = purple_account_get_presence(account);
@@ -241,45 +237,6 @@
}
g_free(stripped);
- /* next, check if there are any changes to the tune values */
- tune = purple_presence_get_status(p, "tune");
- if (purple_status_is_active(tune)) {
- artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
- title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
- source = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
- uri = purple_status_get_attr_string(tune, PURPLE_TUNE_URL);
- track = purple_status_get_attr_string(tune, PURPLE_TUNE_TRACK);
- length = (!purple_status_get_attr_value(tune, PURPLE_TUNE_TIME)) ? -1 :
- purple_status_get_attr_int(tune, PURPLE_TUNE_TIME);
- }
-
- if(!purple_strequal(artist, js->old_artist) || !purple_strequal(title, js->old_title) ||
- !purple_strequal(source, js->old_source) || !purple_strequal(uri, js->old_uri) ||
- !purple_strequal(track, js->old_track) || (length != js->old_length)) {
- PurpleJabberTuneInfo tuneinfo = {
- (char*)artist,
- (char*)title,
- (char*)source,
- (char*)track,
- length,
- (char*)uri
- };
- jabber_tune_set(js->gc, &tuneinfo);
-
- /* update old values */
- g_free(js->old_artist);
- g_free(js->old_title);
- g_free(js->old_source);
- g_free(js->old_uri);
- g_free(js->old_track);
- js->old_artist = g_strdup(artist);
- js->old_title = g_strdup(title);
- js->old_source = g_strdup(source);
- js->old_uri = g_strdup(uri);
- js->old_length = length;
- js->old_track = g_strdup(track);
- }
-
#undef CHANGED
jabber_presence_fake_to_self(js, status);
--- a/libpurple/protocols/jabber/tests/test_jabber_caps.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/protocols/jabber/tests/test_jabber_caps.c Mon Mar 20 21:22:53 2023 -0500
@@ -41,8 +41,8 @@
test_jabber_caps_calculate_from_xmlnode(void) {
_test_jabber_caps_match(
G_CHECKSUM_SHA1,
- "<query xmlns='http://jabber.org/protocol/disco#info' node='http://tkabber.jabber.ru/#GNjxthSckUNvAIoCCJFttjl6VL8='><identity category='client' type='pc' name='Tkabber'/><x xmlns='jabber:x:data' type='result'><field var='FORM_TYPE' type='hidden'><value>urn:xmpp:dataforms:softwareinfo</value></field><field var='software'><value>Tkabber</value></field><field var='software_version'><value> ( 8.5.5 )</value></field><field var='os'><value>ATmega640-16AU</value></field><field var='os_version'><value/></field></x><feature var='games:board'/><feature var='http://jabber.org/protocol/activity'/><feature var='http://jabber.org/protocol/bytestreams'/><feature var='http://jabber.org/protocol/chatstates'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='http://jabber.org/protocol/feature-neg'/><feature var='http://jabber.org/protocol/geoloc'/><feature var='http://jabber.org/protocol/ibb'/><feature var='http://jabber.org/protocol/iqibb'/><feature var='http://jabber.org/protocol/muc'/><feature var='http://jabber.org/protocol/mute#ancestor'/><feature var='http://jabber.org/protocol/mute#editor'/><feature var='http://jabber.org/protocol/rosterx'/><feature var='http://jabber.org/protocol/si'/><feature var='http://jabber.org/protocol/si/profile/file-transfer'/><feature var='http://jabber.org/protocol/tune'/><feature var='jabber:iq:avatar'/><feature var='jabber:iq:browse'/><feature var='jabber:iq:dtcp'/><feature var='jabber:iq:filexfer'/><feature var='jabber:iq:ibb'/><feature var='jabber:iq:inband'/><feature var='jabber:iq:jidlink'/><feature var='jabber:iq:last'/><feature var='jabber:iq:oob'/><feature var='jabber:iq:privacy'/><feature var='jabber:iq:time'/><feature var='jabber:iq:version'/><feature var='jabber:x:data'/><feature var='jabber:x:event'/><feature var='jabber:x:oob'/><feature var='urn:xmpp:ping'/><feature var='urn:xmpp:receipts'/><feature var='urn:xmpp:time'/></query>",
- "MxSGNsM12KCe/2hYIySOX+CpY9U="
+ "<query xmlns='http://jabber.org/protocol/disco#info' node='http://tkabber.jabber.ru/#GNjxthSckUNvAIoCCJFttjl6VL8='><identity category='client' type='pc' name='Tkabber'/><x xmlns='jabber:x:data' type='result'><field var='FORM_TYPE' type='hidden'><value>urn:xmpp:dataforms:softwareinfo</value></field><field var='software'><value>Tkabber</value></field><field var='software_version'><value> ( 8.5.5 )</value></field><field var='os'><value>ATmega640-16AU</value></field><field var='os_version'><value/></field></x><feature var='games:board'/><feature var='http://jabber.org/protocol/activity'/><feature var='http://jabber.org/protocol/bytestreams'/><feature var='http://jabber.org/protocol/chatstates'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='http://jabber.org/protocol/feature-neg'/><feature var='http://jabber.org/protocol/geoloc'/><feature var='http://jabber.org/protocol/ibb'/><feature var='http://jabber.org/protocol/iqibb'/><feature var='http://jabber.org/protocol/muc'/><feature var='http://jabber.org/protocol/mute#ancestor'/><feature var='http://jabber.org/protocol/mute#editor'/><feature var='http://jabber.org/protocol/rosterx'/><feature var='http://jabber.org/protocol/si'/><feature var='http://jabber.org/protocol/si/profile/file-transfer'/><feature var='jabber:iq:avatar'/><feature var='jabber:iq:browse'/><feature var='jabber:iq:dtcp'/><feature var='jabber:iq:filexfer'/><feature var='jabber:iq:ibb'/><feature var='jabber:iq:inband'/><feature var='jabber:iq:jidlink'/><feature var='jabber:iq:last'/><feature var='jabber:iq:oob'/><feature var='jabber:iq:privacy'/><feature var='jabber:iq:time'/><feature var='jabber:iq:version'/><feature var='jabber:x:data'/><feature var='jabber:x:event'/><feature var='jabber:x:oob'/><feature var='urn:xmpp:ping'/><feature var='urn:xmpp:receipts'/><feature var='urn:xmpp:time'/></query>",
+ "sVNUrcvQ2ryBm4L+NRhXrRnd71c="
);
}
--- a/libpurple/protocols/jabber/usertune.c Mon Mar 20 21:14:42 2023 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
- * purple - Jabber Protocol Plugin
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- */
-
-#include <purple.h>
-
-#include "usertune.h"
-#include "pep.h"
-#include <string.h>
-
-static void jabber_tune_cb(JabberStream *js, const char *from, PurpleXmlNode *items) {
- /* it doesn't make sense to have more than one item here, so let's just pick the first one */
- PurpleXmlNode *item = purple_xmlnode_get_child(items, "item");
- JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE);
- PurpleXmlNode *tuneinfo, *tune;
- PurpleJabberTuneInfo tuneinfodata;
- JabberBuddyResource *resource;
- gboolean valid = FALSE;
-
- /* ignore the tune of people not on our buddy list */
- if (!buddy || !item)
- return;
-
- tuneinfodata.artist = NULL;
- tuneinfodata.title = NULL;
- tuneinfodata.album = NULL;
- tuneinfodata.track = NULL;
- tuneinfodata.time = -1;
- tuneinfodata.url = NULL;
-
- tune = purple_xmlnode_get_child_with_namespace(item, "tune", "http://jabber.org/protocol/tune");
- if (!tune)
- return;
- resource = jabber_buddy_find_resource(buddy, NULL);
- if(!resource)
- return; /* huh? */
- for (tuneinfo = tune->child; tuneinfo; tuneinfo = tuneinfo->next) {
- if (tuneinfo->type == PURPLE_XMLNODE_TYPE_TAG) {
- if (purple_strequal(tuneinfo->name, "artist")) {
- if (tuneinfodata.artist == NULL) /* only pick the first one */
- tuneinfodata.artist = purple_xmlnode_get_data(tuneinfo);
- valid = TRUE;
- } else if (purple_strequal(tuneinfo->name, "length")) {
- if (tuneinfodata.time == -1) {
- char *length = purple_xmlnode_get_data(tuneinfo);
- if (length)
- tuneinfodata.time = strtol(length, NULL, 10);
- g_free(length);
- if (tuneinfodata.time > 0)
- valid = TRUE;
- }
- } else if (purple_strequal(tuneinfo->name, "source")) {
- if (tuneinfodata.album == NULL) /* only pick the first one */
- tuneinfodata.album = purple_xmlnode_get_data(tuneinfo);
- valid = TRUE;
- } else if (purple_strequal(tuneinfo->name, "title")) {
- if (tuneinfodata.title == NULL) /* only pick the first one */
- tuneinfodata.title = purple_xmlnode_get_data(tuneinfo);
- valid = TRUE;
- } else if (purple_strequal(tuneinfo->name, "track")) {
- if (tuneinfodata.track == NULL) /* only pick the first one */
- tuneinfodata.track = purple_xmlnode_get_data(tuneinfo);
- valid = TRUE;
- } else if (purple_strequal(tuneinfo->name, "uri")) {
- if (tuneinfodata.url == NULL) /* only pick the first one */
- tuneinfodata.url = purple_xmlnode_get_data(tuneinfo);
- valid = TRUE;
- }
- }
- }
-
- if (valid) {
- purple_protocol_got_user_status(purple_connection_get_account(js->gc), from, "tune",
- PURPLE_TUNE_ARTIST, tuneinfodata.artist,
- PURPLE_TUNE_TITLE, tuneinfodata.title,
- PURPLE_TUNE_ALBUM, tuneinfodata.album,
- PURPLE_TUNE_TRACK, tuneinfodata.track,
- PURPLE_TUNE_TIME, tuneinfodata.time,
- PURPLE_TUNE_URL, tuneinfodata.url, NULL);
- } else {
- purple_protocol_got_user_status_deactive(purple_connection_get_account(js->gc), from, "tune");
- }
-
- g_free(tuneinfodata.artist);
- g_free(tuneinfodata.title);
- g_free(tuneinfodata.album);
- g_free(tuneinfodata.track);
- g_free(tuneinfodata.url);
-}
-
-void jabber_tune_init(void) {
- jabber_add_feature("http://jabber.org/protocol/tune", jabber_pep_namespace_only_when_pep_enabled_cb);
- jabber_pep_register_handler("http://jabber.org/protocol/tune", jabber_tune_cb);
-}
-
-void jabber_tune_set(PurpleConnection *gc, const PurpleJabberTuneInfo *tuneinfo) {
- PurpleXmlNode *publish, *tunenode;
- JabberStream *js = purple_connection_get_protocol_data(gc);
-
- publish = purple_xmlnode_new("publish");
- purple_xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/tune");
- tunenode = purple_xmlnode_new_child(purple_xmlnode_new_child(publish, "item"), "tune");
- purple_xmlnode_set_namespace(tunenode, "http://jabber.org/protocol/tune");
-
- if(tuneinfo) {
- if(tuneinfo->artist && tuneinfo->artist[0] != '\0')
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "artist"),tuneinfo->artist,-1);
- if(tuneinfo->title && tuneinfo->title[0] != '\0')
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "title"),tuneinfo->title,-1);
- if(tuneinfo->album && tuneinfo->album[0] != '\0')
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "source"),tuneinfo->album,-1);
- if(tuneinfo->url && tuneinfo->url[0] != '\0')
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "uri"),tuneinfo->url,-1);
- if(tuneinfo->time > 0) {
- char *length = g_strdup_printf("%d", tuneinfo->time);
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "length"),length,-1);
- g_free(length);
- }
- if(tuneinfo->track && tuneinfo->track[0] != '\0')
- purple_xmlnode_insert_data(purple_xmlnode_new_child(tunenode, "track"),tuneinfo->track,-1);
- }
-
- jabber_pep_publish(js, publish);
- /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free
- (yay for well-defined memory management rules) */
-}
--- a/libpurple/protocols/jabber/usertune.h Mon Mar 20 21:14:42 2023 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * purple - Jabber Protocol Plugin
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- */
-
-#ifndef PURPLE_JABBER_USERTUNE_H
-#define PURPLE_JABBER_USERTUNE_H
-
-#include "jabber.h"
-
-/* Implementation of XEP-0118 */
-
-typedef struct _PurpleJabberTuneInfo PurpleJabberTuneInfo;
-struct _PurpleJabberTuneInfo {
- char *artist;
- char *title;
- char *album;
- char *track; /* either the index of the track in the album or the URL for a stream */
- int time; /* in seconds, -1 for unknown */
- char *url;
-};
-
-void jabber_tune_init(void);
-
-void jabber_tune_set(PurpleConnection *gc, const PurpleJabberTuneInfo *tuneinfo);
-
-#endif /* PURPLE_JABBER_USERTUNE_H */
--- a/libpurple/status.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/status.c Mon Mar 20 21:22:53 2023 -0500
@@ -109,7 +109,6 @@
-100, /* away */
-200, /* extended away */
-400, /* mobile */
- 0, /* tune */
-10, /* idle, special case. */
-5, /* idle time, special case. */
10 /* Offline messageable */
@@ -138,7 +137,6 @@
{ PURPLE_STATUS_AWAY, "away", N_("Away") },
{ PURPLE_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended away") },
{ PURPLE_STATUS_MOBILE, "mobile", N_("Mobile") },
- { PURPLE_STATUS_TUNE, "tune", N_("Listening to music"), },
};
int *
--- a/libpurple/status.h Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/status.h Mon Mar 20 21:22:53 2023 -0500
@@ -91,7 +91,6 @@
* @PURPLE_STATUS_AWAY: The status is away
* @PURPLE_STATUS_EXTENDED_AWAY: The status is extended away/do not disturb
* @PURPLE_STATUS_MOBILE: The status is mobile
- * @PURPLE_STATUS_TUNE: The status includes a song title
* @PURPLE_STATUS_NUM_PRIMITIVES: The number of #PurpleStatusPrimitive<!-- -->s
*
* A primitive defining the basic structure of a status type.
@@ -110,83 +109,12 @@
PURPLE_STATUS_AWAY,
PURPLE_STATUS_EXTENDED_AWAY,
PURPLE_STATUS_MOBILE,
- PURPLE_STATUS_TUNE,
PURPLE_STATUS_NUM_PRIMITIVES, /*< skip >*/
} PurpleStatusPrimitive;
#include "purplepresence.h"
-/**
- * PURPLE_TUNE_ALBUM:
- *
- * A constant for a status attribute that represents the album of a song.
- */
-#define PURPLE_TUNE_ALBUM "tune_album"
-
-/**
- * PURPLE_TUNE_ARTIST:
- *
- * A constant for a status attribute that represents the artists of a song.
- */
-#define PURPLE_TUNE_ARTIST "tune_artist"
-
-/**
- * PURPLE_TUNE_COMMENT:
- *
- * A constant for a status attribute that represents the comment of a song.
- */
-#define PURPLE_TUNE_COMMENT "tune_comment"
-
-/**
- * PURPLE_TUNE_FULL:
- *
- * A constant for a status attribute that represents the full details of a song.
- */
-#define PURPLE_TUNE_FULL "tune_full"
-
-/**
- * PURPLE_TUNE_GENRE:
- *
- * A constant for a status attribute that represents the genre of a song.
- */
-#define PURPLE_TUNE_GENRE "tune_genre"
-
-/**
- * PURPLE_TUNE_TIME:
- *
- * A constant for a status attribute that represents the duration of a song.
- */
-#define PURPLE_TUNE_TIME "tune_time"
-
-/**
- * PURPLE_TUNE_TITLE:
- *
- * A constant for a status attribute that represents the title of a song.
- */
-#define PURPLE_TUNE_TITLE "tune_title"
-
-/**
- * PURPLE_TUNE_TRACK:
- *
- * A constant for a status attribute that represents the track number of a song.
- */
-#define PURPLE_TUNE_TRACK "tune_track"
-
-/**
- * PURPLE_TUNE_URL:
- *
- * A constant for a status attribute that represents the url of a song.
- */
-#define PURPLE_TUNE_URL "tune_url"
-
-/**
- * PURPLE_TUNE_YEAR:
- *
- * A constant for a status attribute that represents the release year of a song.
- */
-#define PURPLE_TUNE_YEAR "tune_year"
-
G_BEGIN_DECLS
/**************************************************************************/
--- a/libpurple/util.c Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/util.c Mon Mar 20 21:22:53 2023 -0500
@@ -993,81 +993,6 @@
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)
{
--- a/libpurple/util.h Mon Mar 20 21:14:42 2023 -0500
+++ b/libpurple/util.h Mon Mar 20 21:22:53 2023 -0500
@@ -39,29 +39,6 @@
G_BEGIN_DECLS
-/**
- * purple_util_set_current_song:
- * @title: The title of the song, %NULL to unset the value.
- * @artist: The artist of the song, can be %NULL.
- * @album: The album of the song, can be %NULL.
- *
- * Set the appropriate presence values for the currently playing song.
- */
-void purple_util_set_current_song(const char *title, const char *artist,
- const char *album);
-
-/**
- * purple_util_format_song_info:
- * @title: The title of the song, %NULL to unset the value.
- * @artist: The artist of the song, can be %NULL.
- * @album: The album of the song, can be %NULL.
- *
- * Format song information.
- *
- * Returns: The formatted string. The caller must g_free the returned string.
- */
-char *purple_util_format_song_info(const char *title, const char *artist, const char *album);
-
/**************************************************************************/
/* Utility Subsystem */
/**************************************************************************/
--- a/pidgin/pidginiconname.c Mon Mar 20 21:14:42 2023 -0500
+++ b/pidgin/pidginiconname.c Mon Mar 20 21:22:53 2023 -0500
@@ -49,7 +49,6 @@
return "pidgin-user-extended-away";
break;
case PURPLE_STATUS_MOBILE:
- case PURPLE_STATUS_TUNE:
case PURPLE_STATUS_UNSET:
default:
break;
--- a/pidgin/plugins/unity/unity.c Mon Mar 20 21:14:42 2023 -0500
+++ b/pidgin/plugins/unity/unity.c Mon Mar 20 21:22:53 2023 -0500
@@ -349,7 +349,6 @@
switch (purple_savedstatus_get_primitive_type(saved_status)) {
case PURPLE_STATUS_AVAILABLE:
- case PURPLE_STATUS_TUNE:
case PURPLE_STATUS_UNSET:
status = MESSAGING_MENU_STATUS_AVAILABLE;
break;
--- a/po/POTFILES.in Mon Mar 20 21:14:42 2023 -0500
+++ b/po/POTFILES.in Mon Mar 20 21:22:53 2023 -0500
@@ -153,7 +153,6 @@
libpurple/protocols/jabber/tests/test_jabber_scram.c
libpurple/protocols/jabber/useravatar.c
libpurple/protocols/jabber/usernick.c
-libpurple/protocols/jabber/usertune.c
libpurple/protocols/jabber/xdata.c
libpurple/protocols/jabber/xmpp.c
libpurple/proxy.c