diff options
42 files changed, 5 insertions, 971 deletions
diff --git a/ChangeLog.API b/ChangeLog.API index 90eca159be..91ba9191b9 100644 --- a/ChangeLog.API +++ b/ChangeLog.API @@ -569,6 +569,7 @@ version 3.0.0 (??/??/????): purple_mime_part_get_length, purple_mime_part_set_data, and purple_mime_decode_field. Use the GMime library, instead. * purple_mkstemp + * PurpleMood and all related APIs. * purple_network_convert_idn_to_ascii. Use g_hostname_to_ascii, instead. * purple_network_get_all_local_system_ips. Use libnice instead. diff --git a/libpurple/connection.h b/libpurple/connection.h index 7e542c1bbd..d79423e4b1 100644 --- a/libpurple/connection.h +++ b/libpurple/connection.h @@ -60,9 +60,6 @@ typedef struct _PurpleConnectionUiOps PurpleConnectionUiOps; * with links * @PURPLE_CONNECTION_FLAG_NO_IMAGES: Connection does not support sending of * images - * @PURPLE_CONNECTION_FLAG_SUPPORT_MOODS: Connection supports setting moods - * @PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES: Connection supports setting - * a message on moods * * Flags to change behavior of the client for a given connection. */ @@ -76,8 +73,6 @@ typedef enum /*< flags >*/ PURPLE_CONNECTION_FLAG_NO_FONTSIZE = 0x0020, PURPLE_CONNECTION_FLAG_NO_URLDESC = 0x0040, PURPLE_CONNECTION_FLAG_NO_IMAGES = 0x0080, - PURPLE_CONNECTION_FLAG_SUPPORT_MOODS = 0x0200, - PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES = 0x0400 } PurpleConnectionFlags; /** diff --git a/libpurple/protocols/jabber/disco.c b/libpurple/protocols/jabber/disco.c index e722186062..dbeffcb02d 100644 --- a/libpurple/protocols/jabber/disco.c +++ b/libpurple/protocols/jabber/disco.c @@ -413,12 +413,7 @@ jabber_disco_server_info_result_cb(JabberStream *js, const char *from, category = purple_xmlnode_get_attrib(child, "category"); type = purple_xmlnode_get_attrib(child, "type"); if(purple_strequal(category, "pubsub") && purple_strequal(type, "pep")) { - PurpleConnection *gc = js->gc; js->pep = TRUE; - purple_connection_set_flags(gc, - purple_connection_get_flags(gc) - | PURPLE_CONNECTION_FLAG_SUPPORT_MOODS - | PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES); } if (!purple_strequal(category, "server")) continue; diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index 7e25c33243..1b5d016901 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -49,7 +49,6 @@ #include "oob.h" #include "ping.h" #include "si.h" -#include "usermood.h" #include "xdata.h" #include "pep.h" #include "adhoccommands.h" @@ -1560,7 +1559,7 @@ jabber_tooltip_add_resource_text(JabberBuddyResource *jbr, } static void -jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b, +jabber_tooltip_text(G_GNUC_UNUSED PurpleProtocolClient *client, PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) { JabberBuddy *jb; @@ -1586,7 +1585,6 @@ jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b, PurplePresence *presence = purple_buddy_get_presence(b); const char *sub; GList *l; - const char *mood; gboolean multiple_resources = jb->resources && g_list_next(jb->resources); JabberBuddyResource *top_jbr = jabber_buddy_find_resource(jb, NULL); @@ -1607,34 +1605,6 @@ jabber_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b, } if (full) { - PurpleStatus *status; - - status = purple_presence_get_status(presence, "mood"); - mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); - if(mood && *mood) { - const char *moodtext; - /* find the mood */ - PurpleMood *moods = jabber_get_moods(client, account); - const char *description = NULL; - - for (; moods->mood ; moods++) { - if (purple_strequal(moods->mood, mood)) { - description = moods->description; - break; - } - } - - moodtext = purple_status_get_attr_string(status, PURPLE_MOOD_COMMENT); - if(moodtext && *moodtext) { - char *moodplustext = - g_strdup_printf("%s (%s)", description ? _(description) : mood, moodtext); - - purple_notify_user_info_add_pair_html(user_info, _("Mood"), moodplustext); - g_free(moodplustext); - } else - purple_notify_user_info_add_pair_html(user_info, _("Mood"), - description ? _(description) : mood); - } 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); @@ -1691,21 +1661,11 @@ jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, NULL, TRUE, TRUE, FALSE, "priority", _("Priority"), priority_value, "message", _("Message"), purple_value_new(G_TYPE_STRING), - "mood", _("Mood"), purple_value_new(G_TYPE_STRING), - "moodtext", _("Mood Text"), purple_value_new(G_TYPE_STRING), "nick", _("Nickname"), purple_value_new(G_TYPE_STRING), "buzz", _("Allow Buzz"), buzz_enabled, NULL); types = g_list_prepend(types, type); - - type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, - "mood", NULL, TRUE, TRUE, TRUE, - PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(G_TYPE_STRING), - PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(G_TYPE_STRING), - NULL); - types = g_list_prepend(types, type); - priority_value = purple_value_new(G_TYPE_INT); g_value_set_int(priority_value, 1); buzz_enabled = purple_value_new(G_TYPE_BOOLEAN); @@ -1715,8 +1675,6 @@ jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, _("Chatty"), TRUE, TRUE, FALSE, "priority", _("Priority"), priority_value, "message", _("Message"), purple_value_new(G_TYPE_STRING), - "mood", _("Mood"), purple_value_new(G_TYPE_STRING), - "moodtext", _("Mood Text"), purple_value_new(G_TYPE_STRING), "nick", _("Nickname"), purple_value_new(G_TYPE_STRING), "buzz", _("Allow Buzz"), buzz_enabled, NULL); @@ -1731,8 +1689,6 @@ jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, NULL, TRUE, TRUE, FALSE, "priority", _("Priority"), priority_value, "message", _("Message"), purple_value_new(G_TYPE_STRING), - "mood", _("Mood"), purple_value_new(G_TYPE_STRING), - "moodtext", _("Mood Text"), purple_value_new(G_TYPE_STRING), "nick", _("Nickname"), purple_value_new(G_TYPE_STRING), "buzz", _("Allow Buzz"), buzz_enabled, NULL); @@ -1747,8 +1703,6 @@ jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, NULL, TRUE, TRUE, FALSE, "priority", _("Priority"), priority_value, "message", _("Message"), purple_value_new(G_TYPE_STRING), - "mood", _("Mood"), purple_value_new(G_TYPE_STRING), - "moodtext", _("Mood Text"), purple_value_new(G_TYPE_STRING), "nick", _("Nickname"), purple_value_new(G_TYPE_STRING), "buzz", _("Allow Buzz"), buzz_enabled, NULL); @@ -1761,8 +1715,6 @@ jabber_status_types(G_GNUC_UNUSED PurpleProtocol *protocol, _("Do Not Disturb"), TRUE, TRUE, FALSE, "priority", _("Priority"), priority_value, "message", _("Message"), purple_value_new(G_TYPE_STRING), - "mood", _("Mood"), purple_value_new(G_TYPE_STRING), - "moodtext", _("Mood Text"), purple_value_new(G_TYPE_STRING), "nick", _("Nickname"), purple_value_new(G_TYPE_STRING), NULL); types = g_list_prepend(types, type); @@ -2875,50 +2827,6 @@ jabber_can_receive_file(G_GNUC_UNUSED PurpleProtocolXfer *prplxfer, } } -static PurpleCmdRet -jabber_cmd_mood(PurpleConversation *conv, G_GNUC_UNUSED const char *cmd, - char **args, G_GNUC_UNUSED char **error, - G_GNUC_UNUSED gpointer data) -{ - PurpleAccount *account = purple_conversation_get_account(conv); - JabberStream *js = purple_connection_get_protocol_data(purple_account_get_connection(account)); - - if (js->pep) { - gboolean ret; - - if (!args || !args[0]) { - /* No arguments; unset mood */ - ret = jabber_mood_set(js, NULL, NULL); - } else { - /* At least one argument. Relying on the list of arguments - * being NULL-terminated. - */ - ret = jabber_mood_set(js, args[0], args[1]); - if (!ret) { - /* Let's try again */ - char *tmp = g_strjoin(" ", args[0], args[1], NULL); - ret = jabber_mood_set(js, "undefined", tmp); - g_free(tmp); - } - } - - if (ret) { - return PURPLE_CMD_RET_OK; - } else { - purple_conversation_write_system_message(conv, - _("Failed to specify mood"), - PURPLE_MESSAGE_ERROR); - return PURPLE_CMD_RET_FAILED; - } - } else { - /* account does not support PEP, can't set a mood */ - purple_conversation_write_system_message(conv, - _("Account does not support PEP, can't set mood"), - PURPLE_MESSAGE_ERROR); - return PURPLE_CMD_RET_FAILED; - } -} - static void jabber_register_commands(PurpleProtocol *protocol) { @@ -3020,13 +2928,6 @@ jabber_register_commands(PurpleProtocol *protocol) _("ping <jid>: Ping a user/component/server."), NULL); commands = g_slist_prepend(commands, GUINT_TO_POINTER(id)); - id = purple_cmd_register("mood", "ws", PURPLE_CMD_P_PROTOCOL, - PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | - PURPLE_CMD_FLAG_PROTOCOL_ONLY | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, - proto_id, jabber_cmd_mood, - _("mood <mood> [text]: Set current user mood"), NULL); - commands = g_slist_prepend(commands, GUINT_TO_POINTER(id)); - g_hash_table_insert(jabber_cmds, protocol, commands); } @@ -3382,7 +3283,6 @@ jabber_protocol_client_iface_init(PurpleProtocolClientInterface *client_iface) client_iface->normalize = jabber_client_normalize; client_iface->find_blist_chat = jabber_find_blist_chat; client_iface->offline_message = jabber_offline_message; - client_iface->get_moods = jabber_get_moods; } static void diff --git a/libpurple/protocols/jabber/meson.build b/libpurple/protocols/jabber/meson.build index f115ee9738..3579f14fc6 100644 --- a/libpurple/protocols/jabber/meson.build +++ b/libpurple/protocols/jabber/meson.build @@ -66,8 +66,6 @@ JABBER_SOURCES = [ 'si.h', 'useravatar.c', 'useravatar.h', - 'usermood.c', - 'usermood.h', 'usernick.c', 'usernick.h', 'usertune.c', diff --git a/libpurple/protocols/jabber/pep.c b/libpurple/protocols/jabber/pep.c index 24b972899a..28fcba2320 100644 --- a/libpurple/protocols/jabber/pep.c +++ b/libpurple/protocols/jabber/pep.c @@ -27,7 +27,6 @@ #include "iq.h" #include <string.h> #include "useravatar.h" -#include "usermood.h" #include "usernick.h" #include "usertune.h" @@ -39,7 +38,6 @@ void jabber_pep_init(void) { /* register PEP handlers */ jabber_avatar_init(); - jabber_mood_init(); jabber_tune_init(); jabber_nick_init(); } diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c index cc75ac5ef1..4baf4f3e16 100644 --- a/libpurple/protocols/jabber/presence.c +++ b/libpurple/protocols/jabber/presence.c @@ -31,7 +31,6 @@ #include "jutil.h" #include "adhoccommands.h" -#include "usermood.h" #include "usertune.h" static GHashTable *presence_handlers = NULL; @@ -169,16 +168,6 @@ jabber_set_status(G_GNUC_UNUSED PurpleProtocolServer *protocol_server, gc = purple_account_get_connection(account); js = purple_connection_get_protocol_data(gc); - /* it's a mood update */ - if (purple_status_type_get_primitive(purple_status_get_status_type(status)) == PURPLE_STATUS_MOOD) { - const char *mood = - purple_status_get_attr_string(status, PURPLE_MOOD_NAME); - const char *mood_text = - purple_status_get_attr_string(status, PURPLE_MOOD_COMMENT); - jabber_mood_set(js, mood, mood_text); - return; - } - jabber_presence_send(js, FALSE); } diff --git a/libpurple/protocols/jabber/tests/test_jabber_caps.c b/libpurple/protocols/jabber/tests/test_jabber_caps.c index c3fc6ceccf..8e07e8463f 100644 --- a/libpurple/protocols/jabber/tests/test_jabber_caps.c +++ b/libpurple/protocols/jabber/tests/test_jabber_caps.c @@ -41,8 +41,8 @@ static void 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/mood'/><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>", - "3V9tfR8fPykyks72jvg+bkUtQTM=" + "<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=" ); } diff --git a/libpurple/protocols/jabber/usermood.c b/libpurple/protocols/jabber/usermood.c deleted file mode 100644 index 10898085a5..0000000000 --- a/libpurple/protocols/jabber/usermood.c +++ /dev/null @@ -1,226 +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 <glib/gi18n-lib.h> - -#include <purple.h> - -#include "usermood.h" -#include "pep.h" -#include <string.h> - -static PurpleMood moods[] = { - { .mood = "afraid", .description = N_("Afraid"), }, - { .mood = "amazed", .description = N_("Amazed"), }, - { .mood = "amorous", .description = N_("Amorous"), }, - { .mood = "angry", .description = N_("Angry"), }, - { .mood = "annoyed", .description = N_("Annoyed"), }, - { .mood = "anxious", .description = N_("Anxious"), }, - { .mood = "aroused", .description = N_("Aroused"), }, - { .mood = "ashamed", .description = N_("Ashamed"), }, - { .mood = "bored", .description = N_("Bored"), }, - { .mood = "brave", .description = N_("Brave"), }, - { .mood = "calm", .description = N_("Calm"), }, - { .mood = "cautious", .description = N_("Cautious"), }, - { .mood = "cold", .description = N_("Cold"), }, - { .mood = "confident", .description = N_("Confident"), }, - { .mood = "confused", .description = N_("Confused"), }, - { .mood = "contemplative", .description = N_("Contemplative"), }, - { .mood = "contented", .description = N_("Contented"), }, - { .mood = "cranky", .description = N_("Cranky"), }, - { .mood = "crazy", .description = N_("Crazy"), }, - { .mood = "creative", .description = N_("Creative"), }, - { .mood = "curious", .description = N_("Curious"), }, - { .mood = "dejected", .description = N_("Dejected"), }, - { .mood = "depressed", .description = N_("Depressed"), }, - { .mood = "disappointed", .description = N_("Disappointed"), }, - { .mood = "disgusted", .description = N_("Disgusted"), }, - { .mood = "dismayed", .description = N_("Dismayed"), }, - { .mood = "distracted", .description = N_("Distracted"), }, - { .mood = "embarrassed", .description = N_("Embarrassed"), }, - { .mood = "envious", .description = N_("Envious"), }, - { .mood = "excited", .description = N_("Excited"), }, - { .mood = "flirtatious", .description = N_("Flirtatious"), }, - { .mood = "frustrated", .description = N_("Frustrated"), }, - { .mood = "grateful", .description = N_("Grateful"), }, - { .mood = "grieving", .description = N_("Grieving"), }, - { .mood = "grumpy", .description = N_("Grumpy"), }, - { .mood = "guilty", .description = N_("Guilty"), }, - { .mood = "happy", .description = N_("Happy"), }, - { .mood = "hopeful", .description = N_("Hopeful"), }, - { .mood = "hot", .description = N_("Hot"), }, - { .mood = "humbled", .description = N_("Humbled"), }, - { .mood = "humiliated", .description = N_("Humiliated"), }, - { .mood = "hungry", .description = N_("Hungry"), }, - { .mood = "hurt", .description = N_("Hurt"), }, - { .mood = "impressed", .description = N_("Impressed"), }, - { .mood = "in_awe", .description = N_("In awe"), }, - { .mood = "in_love", .description = N_("In love"), }, - { .mood = "indignant", .description = N_("Indignant"), }, - { .mood = "interested", .description = N_("Interested"), }, - { .mood = "intoxicated", .description = N_("Intoxicated"), }, - { .mood = "invincible", .description = N_("Invincible"), }, - { .mood = "jealous", .description = N_("Jealous"), }, - { .mood = "lonely", .description = N_("Lonely"), }, - { .mood = "lost", .description = N_("Lost"), }, - { .mood = "lucky", .description = N_("Lucky"), }, - { .mood = "mean", .description = N_("Mean"), }, - { .mood = "moody", .description = N_("Moody"), }, - { .mood = "nervous", .description = N_("Nervous"), }, - { .mood = "neutral", .description = N_("Neutral"), }, - { .mood = "offended", .description = N_("Offended"), }, - { .mood = "outraged", .description = N_("Outraged"), }, - { .mood = "playful", .description = N_("Playful"), }, - { .mood = "proud", .description = N_("Proud"), }, - { .mood = "relaxed", .description = N_("Relaxed"), }, - { .mood = "relieved", .description = N_("Relieved"), }, - { .mood = "remorseful", .description = N_("Remorseful"), }, - { .mood = "restless", .description = N_("Restless"), }, - { .mood = "sad", .description = N_("Sad"), }, - { .mood = "sarcastic", .description = N_("Sarcastic"), }, - { .mood = "satisfied", .description = N_("Satisfied"), }, - { .mood = "serious", .description = N_("Serious"), }, - { .mood = "shocked", .description = N_("Shocked"), }, - { .mood = "shy", .description = N_("Shy"), }, - { .mood = "sick", .description = N_("Sick"), }, - { .mood = "sleepy", .description = N_("Sleepy"), }, - { .mood = "spontaneous", .description = N_("Spontaneous"), }, - { .mood = "stressed", .description = N_("Stressed"), }, - { .mood = "strong", .description = N_("Strong"), }, - { .mood = "surprised", .description = N_("Surprised"), }, - { .mood = "thankful", .description = N_("Thankful"), }, - { .mood = "thirsty", .description = N_("Thirsty"), }, - { .mood = "tired", .description = N_("Tired"), }, - { .mood = "undefined", .description = N_("Undefined"), }, - { .mood = "weak", .description = N_("Weak"), }, - { .mood = "worried", .description = N_("Worried"), }, - /* Mark last record. */ - { .mood = NULL, .description = NULL, } -}; - -static const PurpleMood* -find_mood_by_name(const gchar *name) -{ - int i; - - g_return_val_if_fail(name && *name, NULL); - - for (i = 0; moods[i].mood != NULL; ++i) { - if (purple_strequal(name, moods[i].mood)) { - return &moods[i]; - } - } - - return NULL; -} - -static void jabber_mood_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"); - const char *newmood = NULL; - char *moodtext = NULL; - JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE); - PurpleXmlNode *moodinfo, *mood; - /* ignore the mood of people not on our buddy list */ - if (!buddy || !item) - return; - - mood = purple_xmlnode_get_child_with_namespace(item, "mood", "http://jabber.org/protocol/mood"); - if (!mood) - return; - for (moodinfo = mood->child; moodinfo; moodinfo = moodinfo->next) { - if (moodinfo->type == PURPLE_XMLNODE_TYPE_TAG) { - if (purple_strequal(moodinfo->name, "text")) { - if (!moodtext) /* only pick the first one */ - moodtext = purple_xmlnode_get_data(moodinfo); - } else { - const PurpleMood *target_mood; - - /* verify that the mood is known (valid) */ - target_mood = find_mood_by_name(moodinfo->name); - newmood = target_mood ? target_mood->mood : NULL; - } - - } - if (newmood != NULL && moodtext != NULL) - break; - } - if (newmood != NULL) { - purple_protocol_got_user_status(purple_connection_get_account(js->gc), from, "mood", - PURPLE_MOOD_NAME, newmood, - PURPLE_MOOD_COMMENT, moodtext, - NULL); - } else { - purple_protocol_got_user_status_deactive(purple_connection_get_account(js->gc), from, "mood"); - } - g_free(moodtext); -} - -void jabber_mood_init(void) { - jabber_add_feature("http://jabber.org/protocol/mood", jabber_pep_namespace_only_when_pep_enabled_cb); - jabber_pep_register_handler("http://jabber.org/protocol/mood", jabber_mood_cb); -} - -gboolean -jabber_mood_set(JabberStream *js, const char *mood, const char *text) -{ - const PurpleMood *target_mood = NULL; - PurpleXmlNode *publish, *moodnode; - - if (mood && *mood) { - target_mood = find_mood_by_name(mood); - /* Mood specified, but is invalid -- - * fail so that the command can handle this. - */ - if (!target_mood) - return FALSE; - } - - publish = purple_xmlnode_new("publish"); - purple_xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/mood"); - moodnode = purple_xmlnode_new_child(purple_xmlnode_new_child(publish, "item"), "mood"); - purple_xmlnode_set_namespace(moodnode, "http://jabber.org/protocol/mood"); - - if (target_mood) { - /* If target_mood is not NULL, then - * target_mood->mood == mood, and is a valid element name. - */ - purple_xmlnode_new_child(moodnode, mood); - - /* Only set text when setting a mood */ - if (text && *text) { - PurpleXmlNode *textnode = purple_xmlnode_new_child(moodnode, "text"); - purple_xmlnode_insert_data(textnode, text, -1); - } - } - - jabber_pep_publish(js, publish); - return TRUE; -} - -PurpleMood * -jabber_get_moods(G_GNUC_UNUSED PurpleProtocolClient *client, - G_GNUC_UNUSED PurpleAccount *account) -{ - return moods; -} diff --git a/libpurple/protocols/jabber/usermood.h b/libpurple/protocols/jabber/usermood.h deleted file mode 100644 index a92f49c0be..0000000000 --- a/libpurple/protocols/jabber/usermood.h +++ /dev/null @@ -1,50 +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_USERMOOD_H -#define PURPLE_JABBER_USERMOOD_H - -#include "jabber.h" - -/* Implementation of XEP-0107 */ - -void jabber_mood_init(void); - -/** - * Sets / unsets the mood for the specified account. The mood passed in - * must either be NULL, "", or one of the moods returned by - * jabber_get_moods(). - * - * @param js The JabberStream object. - * @param mood The mood to set, NULL, or "" - * @param text Optional text that goes along with a mood. Only used when - * setting a mood (not when unsetting a mood). - * - * @return FALSE if an invalid mood was specified, or TRUE otherwise. - */ -gboolean -jabber_mood_set(JabberStream *js, const char *mood, const char *text); - -PurpleMood *jabber_get_moods(PurpleProtocolClient *client, PurpleAccount *account); - -#endif /* PURPLE_JABBER_USERMOOD_H */ diff --git a/libpurple/purpleprotocolclient.c b/libpurple/purpleprotocolclient.c index bec0aecd1d..eb173405a6 100644 --- a/libpurple/purpleprotocolclient.c +++ b/libpurple/purpleprotocolclient.c @@ -189,23 +189,6 @@ purple_protocol_client_get_account_text_table(PurpleProtocolClient *client, return NULL; } -PurpleMood * -purple_protocol_client_get_moods(PurpleProtocolClient *client, - PurpleAccount *account) -{ - PurpleProtocolClientInterface *iface = NULL; - - g_return_val_if_fail(PURPLE_IS_PROTOCOL_CLIENT(client), NULL); - g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); - - iface = PURPLE_PROTOCOL_CLIENT_GET_IFACE(client); - if(iface != NULL && iface->get_moods != NULL) { - return iface->get_moods(client, account); - } - - return NULL; -} - gssize purple_protocol_client_get_max_message_size(PurpleProtocolClient *client, PurpleConversation *conv) diff --git a/libpurple/purpleprotocolclient.h b/libpurple/purpleprotocolclient.h index bba020b25a..1d1c74acc3 100644 --- a/libpurple/purpleprotocolclient.h +++ b/libpurple/purpleprotocolclient.h @@ -89,8 +89,6 @@ G_DECLARE_INTERFACE(PurpleProtocolClient, purple_protocol_client, PURPLE, * The hash table should be destroyed * by the caller when it's no longer * needed. - * @get_moods: Returns an array of #PurpleMood's, with the last one having - * "mood" set to %NULL. * @get_max_message_size: Gets the maximum message size in bytes for the * conversation. * <sbr/>It may depend on connection-specific or @@ -135,8 +133,6 @@ struct _PurpleProtocolClientInterface { GHashTable *(*get_account_text_table)(PurpleProtocolClient *client, PurpleAccount *account); - PurpleMood *(*get_moods)(PurpleProtocolClient *client, PurpleAccount *account); - gssize (*get_max_message_size)(PurpleProtocolClient *client, PurpleConversation *conv); /*< private >*/ @@ -277,19 +273,6 @@ gboolean purple_protocol_client_offline_message(PurpleProtocolClient *client, Pu GHashTable *purple_protocol_client_get_account_text_table(PurpleProtocolClient *client, PurpleAccount *account); /** - * purple_protocol_client_get_moods: - * @client: The #PurpleProtocolClient instance. - * @account: A #PurpleAccount instance. - * - * Gets the mood's for @account. - * - * Returns: (transfer none): A %NULL terminated array of #PurpleMood's. - * - * Since: 3.0.0 - */ -PurpleMood *purple_protocol_client_get_moods(PurpleProtocolClient *client, PurpleAccount *account); - -/** * purple_protocol_client_get_max_message_size: * @client: The #PurpleProtocolClient instance. * @conv: A #PurpleConversation instance. diff --git a/libpurple/status.c b/libpurple/status.c index ddf80b8284..fbcdeb460c 100644 --- a/libpurple/status.c +++ b/libpurple/status.c @@ -110,7 +110,6 @@ static int primitive_scores[] = -200, /* extended away */ -400, /* mobile */ 0, /* tune */ - 0, /* mood */ -10, /* idle, special case. */ -5, /* idle time, special case. */ 10 /* Offline messageable */ @@ -140,7 +139,6 @@ static struct PurpleStatusPrimitiveMap { PURPLE_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended away") }, { PURPLE_STATUS_MOBILE, "mobile", N_("Mobile") }, { PURPLE_STATUS_TUNE, "tune", N_("Listening to music"), }, - { PURPLE_STATUS_MOOD, "mood", N_("Feeling") }, }; int * @@ -1008,48 +1006,6 @@ purple_status_attribute_get_type(void) } /************************************************************************** -* GBoxed code for PurpleMood -**************************************************************************/ -static PurpleMood * -purple_mood_copy(PurpleMood *mood) -{ - PurpleMood *mood_copy; - - g_return_val_if_fail(mood != NULL, NULL); - - mood_copy = g_new(PurpleMood, 1); - - mood_copy->mood = g_strdup(mood->mood); - mood_copy->description = g_strdup(mood->description); - - return mood_copy; -} - -static void -purple_mood_free(PurpleMood *mood) -{ - g_free((gchar *)mood->mood); - g_free((gchar *)mood->description); - - g_free(mood); -} - -GType -purple_mood_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - type = g_boxed_type_register_static("PurpleMood", - (GBoxedCopyFunc)purple_mood_copy, - (GBoxedFreeFunc)purple_mood_free); - } - - return type; -} - - -/************************************************************************** * GObject code **************************************************************************/ diff --git a/libpurple/status.h b/libpurple/status.h index b95f1ed81f..70c95723e3 100644 --- a/libpurple/status.h +++ b/libpurple/status.h @@ -81,24 +81,6 @@ typedef struct _PurpleStatusType PurpleStatusType; */ typedef struct _PurpleStatusAttribute PurpleStatusAttribute; -#define PURPLE_TYPE_MOOD (purple_mood_get_type()) - -/** - * PurpleMood: - * @mood: A string representing the mood. - * @description: A short description of the mood. - * - * A structure to represent a mood. - */ -typedef struct { - /*< public >*/ - const char *mood; - const char *description; - - /*< private >*/ - gpointer padding[4]; -} PurpleMood; - /** * PurpleStatusPrimitive: * @PURPLE_STATUS_UNSET: The status is not set @@ -110,7 +92,6 @@ typedef struct { * @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_MOOD: The status includes a mood * @PURPLE_STATUS_NUM_PRIMITIVES: The number of #PurpleStatusPrimitive<!-- -->s * * A primitive defining the basic structure of a status type. @@ -130,7 +111,6 @@ typedef enum PURPLE_STATUS_EXTENDED_AWAY, PURPLE_STATUS_MOBILE, PURPLE_STATUS_TUNE, - PURPLE_STATUS_MOOD, PURPLE_STATUS_NUM_PRIMITIVES, /*< skip >*/ } PurpleStatusPrimitive; @@ -207,9 +187,6 @@ typedef enum */ #define PURPLE_TUNE_YEAR "tune_year" -#define PURPLE_MOOD_NAME "mood" -#define PURPLE_MOOD_COMMENT "moodtext" - G_BEGIN_DECLS /**************************************************************************/ @@ -564,19 +541,6 @@ const char *purple_status_attribute_get_name(const PurpleStatusAttribute *attr); GValue *purple_status_attribute_get_value(const PurpleStatusAttribute *attr); /**************************************************************************/ -/* PurpleMood API */ -/**************************************************************************/ - -/** - * purple_mood_get_type: - * - * The standard _get_type function for #PurpleMood. - * - * Returns: The #GType for the #PurpleMood boxed structure. - */ -GType purple_mood_get_type(void); - -/**************************************************************************/ /* PurpleStatus API */ /**************************************************************************/ diff --git a/pidgin/meson.build b/pidgin/meson.build index 0d2b511628..e525556833 100644 --- a/pidgin/meson.build +++ b/pidgin/meson.build @@ -45,7 +45,6 @@ libpidgin_SOURCES = [ 'pidgininvitedialog.c', 'pidginkeypad.c', 'pidginmessage.c', - 'pidginmooddialog.c', 'pidginnotificationaddcontact.c', 'pidginnotificationauthorizationrequest.c', 'pidginnotificationconnectionerror.c', @@ -113,7 +112,6 @@ libpidgin_headers = [ 'pidgininvitedialog.h', 'pidginkeypad.h', 'pidginmessage.h', - 'pidginmooddialog.h', 'pidginnotificationaddcontact.h', 'pidginnotificationauthorizationrequest.h', 'pidginnotificationconnectionerror.h', diff --git a/pidgin/pidginapplication.c b/pidgin/pidginapplication.c index 177f67ae84..946288726c 100644 --- a/pidgin/pidginapplication.c +++ b/pidgin/pidginapplication.c @@ -48,7 +48,6 @@ #include "pidgincore.h" #include "pidgindebug.h" #include "pidgindisplaywindow.h" -#include "pidginmooddialog.h" #include "pidginpluginsdialog.h" #include "pidginpluginsmenu.h" #include "pidginprefs.h" @@ -220,7 +219,6 @@ static const gchar *pidgin_application_online_actions[] = { "add-group", "get-user-info", "new-message", - "set-mood", }; /*< private > @@ -549,14 +547,6 @@ pidgin_application_room_list(G_GNUC_UNUSED GSimpleAction *simple, } static void -pidgin_application_set_mood(G_GNUC_UNUSED GSimpleAction *simple, - G_GNUC_UNUSED GVariant *parameter, - G_GNUC_UNUSED gpointer data) -{ - pidgin_mood_dialog_show(NULL); -} - -static void pidgin_application_show_status_manager(G_GNUC_UNUSED GSimpleAction *simple, G_GNUC_UNUSED GVariant *parameter, gpointer data) @@ -642,9 +632,6 @@ static GActionEntry app_entries[] = { .name = "room-list", .activate = pidgin_application_room_list, }, { - .name = "set-mood", - .activate = pidgin_application_set_mood, - }, { .name = "status-manager", .activate = pidgin_application_show_status_manager, } diff --git a/pidgin/pidginiconname.c b/pidgin/pidginiconname.c index 2ccebcd170..9de9067f7e 100644 --- a/pidgin/pidginiconname.c +++ b/pidgin/pidginiconname.c @@ -50,7 +50,6 @@ pidgin_icon_name_from_status_primitive(PurpleStatusPrimitive primitive, break; case PURPLE_STATUS_MOBILE: case PURPLE_STATUS_TUNE: - case PURPLE_STATUS_MOOD: case PURPLE_STATUS_UNSET: default: break; diff --git a/pidgin/pidginmooddialog.c b/pidgin/pidginmooddialog.c deleted file mode 100644 index 61e9ea1f93..0000000000 --- a/pidgin/pidginmooddialog.c +++ /dev/null @@ -1,344 +0,0 @@ -/* - * pidgin - * - * Pidgin 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 "pidgin/pidginmooddialog.h" - -#include <glib/gi18n-lib.h> - -#include "config.h" - -/*< private > - * pidgin_mood_update_status: - * @account: The #PurpleAccount instance. - * @mood: The id of the new mood. - * @text: The new status text. - * - * Updates the current status for @account with the given @mood and @text. - */ -static void -update_status_with_mood(PurpleAccount *account, const gchar *mood, - const gchar *text) -{ - if (mood && *mood) { - if (text) { - purple_account_set_status(account, "mood", TRUE, - PURPLE_MOOD_NAME, mood, - PURPLE_MOOD_COMMENT, text, - NULL); - } else { - purple_account_set_status(account, "mood", TRUE, - PURPLE_MOOD_NAME, mood, - NULL); - } - } else { - purple_account_set_status(account, "mood", FALSE, NULL); - } -} - -/*< private - * pidgin_mood_edit_cb: - * @connection: The #PurpleConnection instance. - * @page: The #PurpleRequestPage - * - * This a callback function for when the request dialog has been accepted. - */ -static void -pidgin_mood_dialog_edit_cb(PurpleConnection *connection, - PurpleRequestPage *page) -{ - PurpleRequestFieldList *mood_field = NULL; - GList *l = NULL; - const gchar *mood = NULL; - - mood_field = PURPLE_REQUEST_FIELD_LIST(purple_request_page_get_field(page, - "mood")); - l = purple_request_field_list_get_selected(mood_field); - - if(l == NULL) { - return; - } - - mood = purple_request_field_list_get_data(mood_field, l->data); - - if(connection != NULL) { - PurpleAccount *account = purple_connection_get_account(connection); - PurpleConnectionFlags flags; - const gchar *text = NULL; - - flags = purple_connection_get_flags(connection); - if (flags & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES) { - text = purple_request_page_get_string(page, "text"); - } else { - text = NULL; - } - - update_status_with_mood(account, mood, text); - } else { - 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 = NULL; - - account = g_list_model_get_item(manager_model, index); - connection = purple_account_get_connection(account); - if(PURPLE_IS_CONNECTION(connection)) { - PurpleConnectionFlags flags; - - flags = purple_connection_get_flags(connection); - if(flags & PURPLE_CONNECTION_FLAG_SUPPORT_MOODS) { - update_status_with_mood(account, mood, NULL); - } - } - - g_object_unref(account); - } - } -} - -/*< private > - * pidgin_mood_get_global_moods: - * - * Returns an array of all global moods. - * - * This function should be in libpurple, and it needs a lot of cleanup. It - * should probably also be returning a GList of moods as that's easier to deal - * with. - * - * Also, there is non-deterministic behavior here that the order of the - * returned moods depends purely on the order that the accounts where connected - * in. This is probably okay, but we should look at fixing that somehow. - * - * Returns: (transfer full): A list of all global moods. - */ -static PurpleMood * -pidgin_mood_get_global_moods(void) { - PurpleAccountManager *manager = NULL; - GHashTable *global_moods = NULL; - GHashTable *mood_counts = NULL; - GList *accounts = NULL; - PurpleMood *result = NULL; - GList *out_moods = NULL; - int i = 0; - int num_accounts = 0; - - global_moods = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); - mood_counts = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); - - manager = purple_account_manager_get_default(); - accounts = purple_account_manager_get_enabled(manager); - for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { - PurpleAccount *account = (PurpleAccount *) accounts->data; - if (purple_account_is_connected(account)) { - PurpleConnection *gc = purple_account_get_connection(account); - - if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOODS) { - PurpleProtocol *protocol = purple_connection_get_protocol(gc); - PurpleMood *mood = NULL; - - for (mood = purple_protocol_client_get_moods(PURPLE_PROTOCOL_CLIENT(protocol), account) ; - mood->mood != NULL ; mood++) { - int mood_count = - GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood)); - - if (!g_hash_table_contains(global_moods, mood->mood)) { - g_hash_table_insert(global_moods, (gpointer)mood->mood, mood); - } - g_hash_table_insert(mood_counts, (gpointer)mood->mood, - GINT_TO_POINTER(mood_count + 1)); - } - - num_accounts++; - } - } - } - - result = g_new0(PurpleMood, g_hash_table_size(global_moods) + 1); - - out_moods = g_hash_table_get_values(global_moods); - while (out_moods) { - PurpleMood *mood = (PurpleMood *) out_moods->data; - int in_num_accounts = - GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood)); - - if (in_num_accounts == num_accounts) { - /* mood is present in all accounts supporting moods */ - result[i].mood = mood->mood; - result[i].description = mood->description; - i++; - } - out_moods = g_list_delete_link(out_moods, out_moods); - } - - g_hash_table_destroy(global_moods); - g_hash_table_destroy(mood_counts); - - return result; -} - -/*< private > - * pidgin_mood_get_global_status: - * - * Get the currently selected mood name for all mood support accounts. If no - * mood is set, or accounts have different moods then %NULL is returned. - * - * Returns: The currently selected mood name or %NULL if a mood is not set, or - * accounts are using different moods. - */ -static const gchar * -pidgin_mood_get_global_status(void) { - PurpleAccountManager *manager = NULL; - GList *accounts = NULL; - const gchar *found_mood = NULL; - - manager = purple_account_manager_get_default(); - accounts = purple_account_manager_get_enabled(manager); - for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { - PurpleAccount *account = (PurpleAccount *) accounts->data; - - if (purple_account_is_connected(account) && - (purple_connection_get_flags(purple_account_get_connection(account)) & - PURPLE_CONNECTION_FLAG_SUPPORT_MOODS)) { - PurplePresence *presence = purple_account_get_presence(account); - PurpleStatus *status = purple_presence_get_status(presence, "mood"); - const gchar *curr_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); - - if (found_mood != NULL && !purple_strequal(curr_mood, found_mood)) { - /* found a different mood */ - found_mood = NULL; - break; - } else { - found_mood = curr_mood; - } - } - } - - return found_mood; -} - -/****************************************************************************** - * Public API - *****************************************************************************/ -void -pidgin_mood_dialog_show(PurpleAccount *account) { - const gchar *current_mood; - PurpleRequestPage *page; - PurpleRequestGroup *group = NULL; - PurpleRequestField *field = NULL; - PurpleRequestFieldList *fieldlist = NULL; - PurpleConnection *gc = NULL; - PurpleProtocol *protocol = NULL; - PurpleMood *mood = NULL; - PurpleMood *global_moods = NULL; - - if (account) { - PurplePresence *presence = purple_account_get_presence(account); - PurpleStatus *status = purple_presence_get_status(presence, "mood"); - gc = purple_account_get_connection(account); - g_return_if_fail(purple_connection_get_protocol(gc) != NULL); - protocol = purple_connection_get_protocol(gc); - current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); - } else { - current_mood = pidgin_mood_get_global_status(); - } - - page = purple_request_page_new(); - group = purple_request_group_new(NULL); - field = purple_request_field_list_new("mood", - _("Please select your mood from the list")); - fieldlist = PURPLE_REQUEST_FIELD_LIST(field); - - purple_request_field_list_add_icon(fieldlist, _("None"), NULL, ""); - if(current_mood == NULL) { - purple_request_field_list_add_selected(fieldlist, _("None")); - } - - /* TODO: rlaager wants this sorted. */ - /* TODO: darkrain wants it sorted post-translation */ - if (account && PURPLE_IS_PROTOCOL_CLIENT(protocol)) { - mood = purple_protocol_client_get_moods(PURPLE_PROTOCOL_CLIENT(protocol), account); - } - - if(mood == NULL) { - mood = global_moods = pidgin_mood_get_global_moods(); - } - - for ( ; mood != NULL && mood->mood != NULL ; mood++) { - char *path; - - if (mood->description == NULL) { - continue; - } - - path = pidgin_mood_get_icon_path(mood->mood); - purple_request_field_list_add_icon(fieldlist, _(mood->description), - path, (gpointer)mood->mood); - g_free(path); - - if (current_mood && purple_strequal(current_mood, mood->mood)) - purple_request_field_list_add_selected(fieldlist, _(mood->description)); - } - purple_request_group_add_field(group, field); - - purple_request_page_add_group(page, group); - - /* if the connection allows setting a mood message */ - if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES)) { - group = purple_request_group_new(NULL); - field = purple_request_field_string_new("text", _("Message (optional)"), - NULL, FALSE); - purple_request_group_add_field(group, field); - purple_request_page_add_group(page, group); - } - - purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), - NULL, page, - _("OK"), G_CALLBACK(pidgin_mood_dialog_edit_cb), - _("Cancel"), NULL, - purple_request_cpar_from_connection(gc), gc); - - g_free(global_moods); -} - -gchar * -pidgin_mood_get_icon_path(const gchar *mood) { - gchar *path; - - if(purple_strequal(mood, "busy")) { - path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons", - "hicolor", "16x16", "status", "user-busy.png", NULL); - } else if(purple_strequal(mood, "hiptop")) { - path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons", - "hicolor", "16x16", "emblems", "emblem-hiptop.png", - NULL); - } else { - gchar *filename = g_strdup_printf("%s.png", mood); - path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin", - "emotes", "small", filename, NULL); - g_free(filename); - } - - return path; -} - diff --git a/pidgin/pidginmooddialog.h b/pidgin/pidginmooddialog.h deleted file mode 100644 index 1c263c67fa..0000000000 --- a/pidgin/pidginmooddialog.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * pidgin - * - * Pidgin 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 - */ - -#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) -# error "only <pidgin.h> may be included directly" -#endif - -#ifndef PIDGIN_MOOD_DIALOG_H -#define PIDGIN_MOOD_DIALOG_H - -#include <glib.h> - -#include <gtk/gtk.h> - -#include <purple.h> - -G_BEGIN_DECLS - -/** - * pidgin_mood_dialog_show: - * @account: (nullable): The #PurpleAccount whose mood to set, or %NULL for the - * global mood. - * - * Presents a dialog to select the mood for @account or the global mood if - * @account is %NULL. - */ -void pidgin_mood_dialog_show(PurpleAccount *account); - -/** - * pidgin_mood_get_icon_path: - * @mood: The id of the mood. - * - * Gets the path to the icon for @mood. - * - * Returns: (transfer full): The location of the icon for @mood. - */ -gchar *pidgin_mood_get_icon_path(const gchar *mood); - -G_END_DECLS - -#endif /* PIDGIN_MOOD_DIALOG_H */ - diff --git a/pidgin/pixmaps/emotes/small/16/afraid.png b/pidgin/pixmaps/emotes/small/16/afraid.png Binary files differdeleted file mode 100644 index b10a1a0abf..0000000000 --- a/pidgin/pixmaps/emotes/small/16/afraid.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/bathing.png b/pidgin/pixmaps/emotes/small/16/bathing.png Binary files differdeleted file mode 100644 index 662eb2ac97..0000000000 --- a/pidgin/pixmaps/emotes/small/16/bathing.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/cinema.png b/pidgin/pixmaps/emotes/small/16/cinema.png Binary files differdeleted file mode 100644 index e561cb0791..0000000000 --- a/pidgin/pixmaps/emotes/small/16/cinema.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/disappointed.png b/pidgin/pixmaps/emotes/small/16/disappointed.png Binary files differdeleted file mode 100644 index 3b3e2a12b8..0000000000 --- a/pidgin/pixmaps/emotes/small/16/disappointed.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/embarrassed.png b/pidgin/pixmaps/emotes/small/16/embarrassed.png Binary files differdeleted file mode 100644 index d93f44c044..0000000000 --- a/pidgin/pixmaps/emotes/small/16/embarrassed.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/grumpy.png b/pidgin/pixmaps/emotes/small/16/grumpy.png Binary files differdeleted file mode 100644 index 51a3b81640..0000000000 --- a/pidgin/pixmaps/emotes/small/16/grumpy.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/hot.png b/pidgin/pixmaps/emotes/small/16/hot.png Binary files differdeleted file mode 100644 index 3df80d4d78..0000000000 --- a/pidgin/pixmaps/emotes/small/16/hot.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/internet.png b/pidgin/pixmaps/emotes/small/16/internet.png Binary files differdeleted file mode 100644 index 9281221f98..0000000000 --- a/pidgin/pixmaps/emotes/small/16/internet.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/invincible.png b/pidgin/pixmaps/emotes/small/16/invincible.png Binary files differdeleted file mode 100644 index d6207f3de4..0000000000 --- a/pidgin/pixmaps/emotes/small/16/invincible.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/meson.build b/pidgin/pixmaps/emotes/small/16/meson.build index c906fa285f..6d717f3e53 100644 --- a/pidgin/pixmaps/emotes/small/16/meson.build +++ b/pidgin/pixmaps/emotes/small/16/meson.build @@ -1,26 +1,3 @@ -# These are mood images that are NOT also used in the smiley theme. -MOODS = [ - 'afraid.png', - 'bathing.png', - 'cinema.png', - 'disappointed.png', - 'embarrassed.png', - 'grumpy.png', - 'hot.png', - 'internet.png', - 'invincible.png', - 'music.png', - 'restroom.png', - 'search.png', - 'shopping.png', - 'studying.png', - 'suit.png', - 'surfing.png', - 'typing.png', - 'working.png', - 'writing.png' -] - SMILEYS = [ 'amorous.png', 'angel.png', @@ -94,4 +71,4 @@ custom_target('small-theme', install : true, install_dir : pidginsmileypixdir) -install_data(MOODS + SMILEYS, install_dir : pidginsmileypixdir) +install_data(SMILEYS, install_dir : pidginsmileypixdir) diff --git a/pidgin/pixmaps/emotes/small/16/music.png b/pidgin/pixmaps/emotes/small/16/music.png Binary files differdeleted file mode 100644 index 4b40b6eedf..0000000000 --- a/pidgin/pixmaps/emotes/small/16/music.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/restroom.png b/pidgin/pixmaps/emotes/small/16/restroom.png Binary files differdeleted file mode 100644 index a642e7d53c..0000000000 --- a/pidgin/pixmaps/emotes/small/16/restroom.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/search.png b/pidgin/pixmaps/emotes/small/16/search.png Binary files differdeleted file mode 100644 index 47bf89f81c..0000000000 --- a/pidgin/pixmaps/emotes/small/16/search.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/shopping.png b/pidgin/pixmaps/emotes/small/16/shopping.png Binary files differdeleted file mode 100644 index 291107ae64..0000000000 --- a/pidgin/pixmaps/emotes/small/16/shopping.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/studying.png b/pidgin/pixmaps/emotes/small/16/studying.png Binary files differdeleted file mode 100644 index 0a6053f86c..0000000000 --- a/pidgin/pixmaps/emotes/small/16/studying.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/suit.png b/pidgin/pixmaps/emotes/small/16/suit.png Binary files differdeleted file mode 100644 index 3c0080f0dd..0000000000 --- a/pidgin/pixmaps/emotes/small/16/suit.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/surfing.png b/pidgin/pixmaps/emotes/small/16/surfing.png Binary files differdeleted file mode 100644 index 727b352f72..0000000000 --- a/pidgin/pixmaps/emotes/small/16/surfing.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/typing.png b/pidgin/pixmaps/emotes/small/16/typing.png Binary files differdeleted file mode 100644 index 7f60b0a25e..0000000000 --- a/pidgin/pixmaps/emotes/small/16/typing.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/working.png b/pidgin/pixmaps/emotes/small/16/working.png Binary files differdeleted file mode 100644 index cc90d637df..0000000000 --- a/pidgin/pixmaps/emotes/small/16/working.png +++ /dev/null diff --git a/pidgin/pixmaps/emotes/small/16/writing.png b/pidgin/pixmaps/emotes/small/16/writing.png Binary files differdeleted file mode 100644 index e8b5d0d53e..0000000000 --- a/pidgin/pixmaps/emotes/small/16/writing.png +++ /dev/null diff --git a/pidgin/plugins/unity/unity.c b/pidgin/plugins/unity/unity.c index 89159f60ed..538ca5f3fb 100644 --- a/pidgin/plugins/unity/unity.c +++ b/pidgin/plugins/unity/unity.c @@ -349,7 +349,6 @@ status_changed_cb(PurpleSavedStatus *saved_status) switch (purple_savedstatus_get_primitive_type(saved_status)) { case PURPLE_STATUS_AVAILABLE: - case PURPLE_STATUS_MOOD: case PURPLE_STATUS_TUNE: case PURPLE_STATUS_UNSET: status = MESSAGING_MENU_STATUS_AVAILABLE; diff --git a/pidgin/resources/gtk/menus.ui b/pidgin/resources/gtk/menus.ui index ac36573aba..9e24d4f44b 100644 --- a/pidgin/resources/gtk/menus.ui +++ b/pidgin/resources/gtk/menus.ui @@ -183,11 +183,6 @@ along with this program; if not, see <https://www.gnu.org/licenses/>. <attribute name="accel"><Primary>P</attribute> </item> <item> - <attribute name="label" translatable="yes">Set _Mood</attribute> - <attribute name="action">app.set-mood</attribute> - <attribute name="accel"><Primary>D</attribute> - </item> - <item> <attribute name="label" translatable="yes">_Statuses</attribute> <attribute name="action">app.status-manager</attribute> </item> diff --git a/po/POTFILES.in b/po/POTFILES.in index 198f3c89d5..61c6e5a50b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -152,7 +152,6 @@ libpurple/protocols/jabber/tests/test_jabber_digest_md5.c libpurple/protocols/jabber/tests/test_jabber_jutil.c libpurple/protocols/jabber/tests/test_jabber_scram.c libpurple/protocols/jabber/useravatar.c -libpurple/protocols/jabber/usermood.c libpurple/protocols/jabber/usernick.c libpurple/protocols/jabber/usertune.c libpurple/protocols/jabber/xdata.c @@ -282,7 +281,6 @@ pidgin/pidgininfopane.c pidgin/pidgininvitedialog.c pidgin/pidginkeypad.c pidgin/pidginmessage.c -pidgin/pidginmooddialog.c pidgin/pidginplugininfo.c pidgin/pidginpluginsdialog.c pidgin/pidginpluginsmenu.c |