--- a/doc/reference/pidgin/pidgin-docs.xml Tue Apr 07 01:20:01 2020 -0500
+++ b/doc/reference/pidgin/pidgin-docs.xml Tue Apr 07 02:27:08 2020 -0500
@@ -65,6 +65,7 @@
<xi:include href="xml/pidginlog.xml" />
<xi:include href="xml/pidginmenutray.xml" />
<xi:include href="xml/pidginmessage.xml" />
+ <xi:include href="xml/pidginmooddialog.xml" /> <xi:include href="xml/pidginplugininfo.xml" />
<xi:include href="xml/pidginpluginsdialog.xml" />
<xi:include href="xml/pidginpluginsmenu.xml" />
--- a/pidgin/gtkblist.c Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/gtkblist.c Tue Apr 07 02:27:08 2020 -0500
@@ -60,6 +60,7 @@
#include "pidgin/pidgindebug.h"
#include "pidgin/pidgingdkpixbuf.h"
#include "pidgin/pidginlog.h"
+#include "pidgin/pidginmooddialog.h" #include "pidgin/pidginplugininfo.h"
#include "pidgin/pidgintooltip.h"
#include "pidginmenutray.h"
@@ -3249,287 +3250,6 @@
-static char *get_mood_icon_path(const char *mood)
- 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",
- char *filename = g_strdup_printf("%s.png", mood);
- path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
- "emotes", "small", filename, NULL);
-update_status_with_mood(PurpleAccount *account, const gchar *mood,
- purple_account_set_status(account, "mood", TRUE,
- PURPLE_MOOD_NAME, mood,
- PURPLE_MOOD_COMMENT, text,
- purple_account_set_status(account, "mood", TRUE,
- PURPLE_MOOD_NAME, mood,
- purple_account_set_status(account, "mood", FALSE, NULL);
-edit_mood_cb(PurpleConnection *gc, PurpleRequestFields *fields)
- PurpleRequestField *mood_field;
- mood_field = purple_request_fields_get_field(fields, "mood");
- l = purple_request_field_list_get_selected(mood_field);
- const char *mood = purple_request_field_list_get_data(mood_field, l->data);
- PurpleAccount *account = purple_connection_get_account(gc);
- if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES) {
- PurpleRequestField *text_field;
- text_field = purple_request_fields_get_field(fields, "text");
- text = purple_request_field_string_get_value(text_field);
- update_status_with_mood(account, mood, text);
- GList *accounts = purple_accounts_get_all_active();
- for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) {
- PurpleAccount *account = (PurpleAccount *) accounts->data;
- PurpleConnection *gc = purple_account_get_connection(account);
- if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOODS)) {
- update_status_with_mood(account, mood, NULL);
-global_moods_for_each(gpointer key, gpointer value, gpointer user_data)
- GList **out_moods = (GList **) user_data;
- PurpleMood *mood = (PurpleMood *) value;
- *out_moods = g_list_append(*out_moods, mood);
- GHashTable *global_moods =
- g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
- GHashTable *mood_counts =
- g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
- GList *accounts = purple_accounts_get_all_active();
- PurpleMood *result = NULL;
- GList *out_moods = NULL;
- 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_iface_get_moods(protocol, account) ;
- mood->mood != NULL ; mood++) {
- GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood));
- if (!g_hash_table_lookup(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));
- g_hash_table_foreach(global_moods, global_moods_for_each, &out_moods);
- result = g_new0(PurpleMood, g_hash_table_size(global_moods) + 1);
- PurpleMood *mood = (PurpleMood *) out_moods->data;
- 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;
- out_moods = g_list_delete_link(out_moods, out_moods);
- g_hash_table_destroy(global_moods);
- g_hash_table_destroy(mood_counts);
-/* get current set mood for all mood-supporting accounts, or NULL if not set
- or not set to the same on all */
-get_global_mood_status(void)
- GList *accounts = purple_accounts_get_all_active();
- const gchar *found_mood = NULL;
- 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 = curr_mood;
-set_mood_cb(GtkWidget *widget, PurpleAccount *account)
- const char *current_mood;
- PurpleRequestFields *fields;
- PurpleRequestFieldGroup *g;
- PurpleConnection *gc = NULL;
- PurpleProtocol *protocol = NULL;
- PurpleMood *global_moods = NULL;
- 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);
- current_mood = get_global_mood_status();
- fields = purple_request_fields_new();
- g = purple_request_field_group_new(NULL);
- f = purple_request_field_list_new("mood", _("Please select your mood from the list"));
- purple_request_field_list_add_icon(f, _("None"), NULL, "");
- if (current_mood == NULL)
- purple_request_field_list_add_selected(f, _("None"));
- /* TODO: rlaager wants this sorted. */
- /* TODO: darkrain wants it sorted post-translation */
- if (account && PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, get_moods)) {
- mood = purple_protocol_client_iface_get_moods(protocol, account);
- mood = global_moods = get_global_moods();
- for ( ; mood->mood != NULL ; mood++) {
- if (mood->description == NULL) {
- path = get_mood_icon_path(mood->mood);
- purple_request_field_list_add_icon(f, _(mood->description),
- path, (gpointer)mood->mood);
- if (current_mood && purple_strequal(current_mood, mood->mood))
- purple_request_field_list_add_selected(f, _(mood->description));
- purple_request_field_group_add_field(g, f);
- purple_request_fields_add_group(fields, g);
- /* if the connection allows setting a mood message */
- if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES)) {
- g = purple_request_field_group_new(NULL);
- f = purple_request_field_string_new("text",
- _("Message (optional)"), NULL, FALSE);
- purple_request_field_group_add_field(g, f);
- purple_request_fields_add_group(fields, g);
- purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"),
- _("OK"), G_CALLBACK(edit_mood_cb),
- purple_request_cpar_from_connection(gc), gc);
- set_mood_cb(NULL, NULL);
-/***************************************************
- ***************************************************/
-static const GtkActionEntry blist_menu_entries[] = {
- { "ToolsMenu", NULL, N_("_Tools"), NULL, NULL, NULL },
- { "SetMood", NULL, N_("Set _Mood"), "<control>D", NULL, set_mood_show },
-static const char *blist_menu =
- "<menubar name='BList'>"
- "<menu action='ToolsMenu'>"
- "<menuitem action='SetMood'/>"
/*********************************************************
* Private Utility functions *
*********************************************************/
@@ -3928,7 +3648,7 @@
- path = get_mood_icon_path(name);
+ path = pidgin_mood_get_icon_path(name); filename = g_strdup_printf("emblem-%s.png", name);
path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons",
@@ -5429,7 +5149,6 @@
GSimpleActionGroup *actions;
GtkTreeViewColumn *column;
@@ -5437,9 +5156,6 @@
- GtkActionGroup *action_group;
- GtkAccelGroup *accel_group;
GtkTreeSelection *selection;
GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
{"application/x-im-contact", 0, DRAG_BUDDY},
@@ -5496,38 +5212,11 @@
gtk_widget_insert_action_group(gtkblist->window, "blist",
G_ACTION_GROUP(actions));
- action_group = gtk_action_group_new("BListActions");
- gtk_action_group_set_translation_domain(action_group, PACKAGE);
- gtk_action_group_add_actions(action_group,
- G_N_ELEMENTS(blist_menu_entries),
- GTK_WINDOW(gtkblist->window));
- gtkblist->ui = gtk_ui_manager_new();
- gtk_ui_manager_insert_action_group(gtkblist->ui, action_group, 0);
- accel_group = gtk_ui_manager_get_accel_group(gtkblist->ui);
- gtk_window_add_accel_group(GTK_WINDOW(gtkblist->window), accel_group);
- g_signal_connect(G_OBJECT(accel_group), "accel-changed", G_CALLBACK(pidgin_save_accels_cb), NULL);
- if (!gtk_ui_manager_add_ui_from_string(gtkblist->ui, blist_menu, -1, &error))
- g_message("building menus failed: %s", error->message);
- menu = gtk_ui_manager_get_widget(gtkblist->ui, "/BList");
- gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), menu, FALSE, FALSE, 0);
gtkblist->menu = pidgin_buddy_list_menu_new();
gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), gtkblist->menu, FALSE,
- gtkblist->menutray = pidgin_buddy_list_menu_get_menu_tray(gtkblist->menu);
+ gtkblist->menutray = pidgin_buddy_list_menu_get_menu_tray(PIDGIN_BUDDY_LIST_MENU(gtkblist->menu)); /****************************** Notebook *************************************/
gtkblist->notebook = gtk_notebook_new();
@@ -7214,7 +6903,6 @@
gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL;
g_clear_object(>kblist->treemodel);
- g_object_unref(G_OBJECT(gtkblist->ui));
g_object_unref(G_OBJECT(gtkblist->empty_avatar));
g_clear_object(&priv->current_theme);
@@ -7572,7 +7260,7 @@
- if ((gtkblist == NULL) || (gtkblist->ui == NULL))
--- a/pidgin/gtkblist.h Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/gtkblist.h Tue Apr 07 02:27:08 2020 -0500
@@ -119,7 +119,6 @@
GtkCellRenderer *text_rend;
--- a/pidgin/meson.build Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/meson.build Tue Apr 07 02:27:08 2020 -0500
@@ -46,6 +46,7 @@
@@ -105,6 +106,7 @@
--- a/pidgin/pidginaccountactionsmenu.c Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/pidginaccountactionsmenu.c Tue Apr 07 02:27:08 2020 -0500
@@ -26,8 +26,9 @@
+#include "pidgin/gtkaccount.h" #include "pidgin/pidgin.h"
-#include "pidgin/gtkaccount.h"
+#include "pidgin/pidginmooddialog.h" struct _PidginAccountActionsMenu {
@@ -64,7 +65,9 @@
pidgin_account_actions_menu_set_mood_cb(GtkMenuItem *item, gpointer data) {
- g_warning("open the mood dialog");
+ PidginAccountActionsMenu *menu = PIDGIN_ACCOUNT_ACTIONS_MENU(data); + pidgin_mood_dialog_show(menu->account); --- a/pidgin/pidginactiongroup.c Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/pidginactiongroup.c Tue Apr 07 02:27:08 2020 -0500
@@ -36,6 +36,7 @@
#include "pidgin/gtkxfer.h"
#include "pidgin/pidginabout.h"
#include "pidgin/pidginlog.h"
+#include "pidgin/pidginmooddialog.h" struct _PidginActionGroup {
GSimpleActionGroup parent;
@@ -56,6 +57,7 @@
PIDGIN_ACTION_GET_USER_INFO,
PIDGIN_ACTION_NEW_MESSAGE,
+ PIDGIN_ACTION_SET_MOOD, static const gchar *pidgin_action_group_chat_actions[] = {
@@ -604,6 +606,13 @@
+pidgin_action_group_set_mood(GSimpleAction *simple, GVariant *parameter, + pidgin_mood_dialog_show(NULL); pidgin_action_group_show_buddy_icons(GSimpleAction *action, GVariant *value,
@@ -731,6 +740,9 @@
.name = PIDGIN_ACTION_ROOM_LIST,
.activate = pidgin_action_group_room_list,
+ .name = PIDGIN_ACTION_SET_MOOD, + .activate = pidgin_action_group_set_mood, .name = PIDGIN_ACTION_SHOW_BUDDY_ICONS,
.change_state = pidgin_action_group_show_buddy_icons,
--- a/pidgin/pidginactiongroup.h Tue Apr 07 01:20:01 2020 -0500
+++ b/pidgin/pidginactiongroup.h Tue Apr 07 02:27:08 2020 -0500
@@ -152,6 +152,13 @@
#define PIDGIN_ACTION_ROOM_LIST ("room-list")
+ * PIDGIN_ACTION_SET_MOOD: + * A constant that represents the set-mood action. +#define PIDGIN_ACTION_SET_MOOD ("set-mood") * PIDGIN_ACTION_SHOW_BUDDY_ICONS:
* A constant that represents the show-buddy-icons action.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginmooddialog.c Tue Apr 07 02:27:08 2020 -0500
@@ -0,0 +1,316 @@
+ * 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 + * 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" + * 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. +update_status_with_mood(PurpleAccount *account, const gchar *mood, + purple_account_set_status(account, "mood", TRUE, + PURPLE_MOOD_NAME, mood, + PURPLE_MOOD_COMMENT, text, + purple_account_set_status(account, "mood", TRUE, + PURPLE_MOOD_NAME, mood, + purple_account_set_status(account, "mood", FALSE, NULL); + * @gc: The #PurpleConnection instance. + * @fields: The #PurpleRequestFields + * This a callback function for when the request dialog has been accepted. +pidgin_mood_dialog_edit_cb(PurpleConnection *gc, PurpleRequestFields *fields) { + PurpleRequestField *mood_field; + const gchar *mood = NULL; + mood_field = purple_request_fields_get_field(fields, "mood"); + l = purple_request_field_list_get_selected(mood_field); + mood = purple_request_field_list_get_data(mood_field, l->data); + PurpleAccount *account = purple_connection_get_account(gc); + if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES) { + PurpleRequestField *text_field; + text_field = purple_request_fields_get_field(fields, "text"); + text = purple_request_field_string_get_value(text_field); + update_status_with_mood(account, mood, text); + GList *accounts = purple_accounts_get_all_active(); + for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { + PurpleAccount *account = (PurpleAccount *) accounts->data; + PurpleConnection *gc = purple_account_get_connection(account); + if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOODS)) { + update_status_with_mood(account, mood, NULL); + * 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 + * Also, there is non-deterministic behavior here that the return mood 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 container): A list of all global moods. +pidgin_mood_get_global_moods(void) { + GHashTable *global_moods = NULL; + GHashTable *mood_counts = NULL; + GList *accounts = NULL; + PurpleMood *result = NULL; + GList *out_moods = NULL; + 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); + accounts = purple_accounts_get_all_active(); + 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_iface_get_moods(protocol, account) ; + mood->mood != NULL ; mood++) { + GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood)); + if (!g_hash_table_lookup(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)); + result = g_new0(PurpleMood, g_hash_table_size(global_moods) + 1); + out_moods = g_hash_table_get_values(global_moods); + PurpleMood *mood = (PurpleMood *) out_moods->data; + 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; + out_moods = g_list_delete_link(out_moods, out_moods); + g_hash_table_destroy(global_moods); + g_hash_table_destroy(mood_counts); + * 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. +pidgin_mood_get_global_status(void) { + GList *accounts = purple_accounts_get_all_active(); + const gchar *found_mood = NULL; + 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 = curr_mood; +/****************************************************************************** + *****************************************************************************/ +pidgin_mood_dialog_show(PurpleAccount *account) { + const gchar *current_mood; + PurpleRequestFields *fields; + PurpleRequestFieldGroup *g; + PurpleConnection *gc = NULL; + PurpleProtocol *protocol = NULL; + PurpleMood *global_moods = NULL; + 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); + current_mood = pidgin_mood_get_global_status(); + fields = purple_request_fields_new(); + g = purple_request_field_group_new(NULL); + f = purple_request_field_list_new("mood", _("Please select your mood from the list")); + purple_request_field_list_add_icon(f, _("None"), NULL, ""); + if (current_mood == NULL) + purple_request_field_list_add_selected(f, _("None")); + /* TODO: rlaager wants this sorted. */ + /* TODO: darkrain wants it sorted post-translation */ + if (account && PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT, get_moods)) { + mood = purple_protocol_client_iface_get_moods(protocol, account); + mood = global_moods = pidgin_mood_get_global_moods(); + for ( ; mood->mood != NULL ; mood++) { + if (mood->description == NULL) { + path = pidgin_mood_get_icon_path(mood->mood); + purple_request_field_list_add_icon(f, _(mood->description), + path, (gpointer)mood->mood); + if (current_mood && purple_strequal(current_mood, mood->mood)) + purple_request_field_list_add_selected(f, _(mood->description)); + purple_request_field_group_add_field(g, f); + purple_request_fields_add_group(fields, g); + /* if the connection allows setting a mood message */ + if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES)) { + g = purple_request_field_group_new(NULL); + f = purple_request_field_string_new("text", + _("Message (optional)"), NULL, FALSE); + purple_request_field_group_add_field(g, f); + purple_request_fields_add_group(fields, g); + purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), + _("OK"), G_CALLBACK(pidgin_mood_dialog_edit_cb), + purple_request_cpar_from_connection(gc), gc); +pidgin_mood_get_icon_path(const gchar *mood) { + 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", + gchar *filename = g_strdup_printf("%s.png", mood); + path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin", + "emotes", "small", filename, NULL); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginmooddialog.h Tue Apr 07 02:27:08 2020 -0500
@@ -0,0 +1,66 @@
+ * 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 + * 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 PIDGIN_MOOD_DIALOG_H +#define PIDGIN_MOOD_DIALOG_H + * SECTION:pidginmooddialog + * @section_id: pidgin-mood-dialog + * @short_description: A dialog for selecting moods + * A simple dialog for selecting a global mood as well as a per account mood. + * pidgin_mood_dialog_show: + * @account: (nullable): The #PurpleAccount who's mood to set, or %NULL for the + * Presents a dialog to select the mood for @account or the global mood if +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); +#endif /* PIDGIN_MOOD_DIALOG_H */