qulogic/pidgin

32dc4a2380b4
Parents 0622b87a3b8f
Children 87654d7a8f79
Remove unused actions from the display window

We removed a bunch of these previously as they were context dependent and we
want to make those more obvious in the future.

For the actions that were the only user of old dialog functions, this commit
deletes those functions as well.

Testing Done:
Consulted with turtles and verified a few accounts connected without issue.

Reviewed at https://reviews.imfreedom.org/r/2897/
--- a/ChangeLog.API Sat Dec 30 20:04:22 2023 -0600
+++ b/ChangeLog.API Sat Dec 30 20:06:39 2023 -0600
@@ -1063,6 +1063,8 @@
* pidgin_dialog_get_action_area
* pidgin_dialog_get_vbox
* pidgin_dialog_get_vbox_with_properties
+ * pidgin_dialogs_alias_buddy
+ * pidgin_dialogs_alias_chat
* pidgin_dialogs_alias_contact
* pidgin_dialogs_destroy_all
* pidgin_dialogs_log
--- a/pidgin/gtkdialogs.c Sat Dec 30 20:04:22 2023 -0600
+++ b/pidgin/gtkdialogs.c Sat Dec 30 20:06:39 2023 -0600
@@ -177,56 +177,3 @@
page, _("OK"), G_CALLBACK(pidgin_dialogs_info_cb),
_("Cancel"), NULL, NULL, NULL);
}
-
-static void
-pidgin_dialogs_alias_buddy_cb(PurpleBuddy *buddy, const char *new_alias)
-{
- purple_buddy_set_local_alias(buddy, new_alias);
- purple_serv_alias_buddy(buddy);
-}
-
-void
-pidgin_dialogs_alias_buddy(PurpleBuddy *buddy)
-{
- gchar *secondary;
-
- g_return_if_fail(buddy != NULL);
-
- secondary = g_strdup_printf(_("Enter an alias for %s."), purple_buddy_get_name(buddy));
-
- purple_request_input(NULL, _("Alias Buddy"), NULL,
- secondary, purple_buddy_get_local_alias(buddy), FALSE, FALSE, NULL,
- _("Alias"), G_CALLBACK(pidgin_dialogs_alias_buddy_cb),
- _("Cancel"), NULL,
- purple_request_cpar_from_account(purple_buddy_get_account(buddy)),
- buddy);
-
- g_free(secondary);
-}
-
-static void
-pidgin_dialogs_alias_chat_cb(PurpleChat *chat, const char *new_alias)
-{
- purple_chat_set_alias(chat, new_alias);
-}
-
-void
-pidgin_dialogs_alias_chat(PurpleChat *chat)
-{
- gchar *alias;
-
- g_return_if_fail(chat != NULL);
-
- g_object_get(chat, "alias", &alias, NULL);
-
- purple_request_input(NULL, _("Alias Chat"), NULL,
- _("Enter an alias for this chat."),
- alias, FALSE, FALSE, NULL,
- _("Alias"), G_CALLBACK(pidgin_dialogs_alias_chat_cb),
- _("Cancel"), NULL,
- purple_request_cpar_from_account(purple_chat_get_account(chat)),
- chat);
-
- g_free(alias);
-}
-
--- a/pidgin/gtkdialogs.h Sat Dec 30 20:04:22 2023 -0600
+++ b/pidgin/gtkdialogs.h Sat Dec 30 20:06:39 2023 -0600
@@ -41,12 +41,6 @@
PIDGIN_AVAILABLE_IN_ALL
void pidgin_dialogs_info(void);
-PIDGIN_AVAILABLE_IN_ALL
-void pidgin_dialogs_alias_buddy(PurpleBuddy *buddy);
-
-PIDGIN_AVAILABLE_IN_ALL
-void pidgin_dialogs_alias_chat(PurpleChat *chat);
-
G_END_DECLS
#endif /* _PIDGINDIALOGS_H_ */
--- a/pidgin/pidgindisplaywindow.c Sat Dec 30 20:04:22 2023 -0600
+++ b/pidgin/pidgindisplaywindow.c Sat Dec 30 20:06:39 2023 -0600
@@ -102,74 +102,9 @@
}
/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static void
-pidgin_display_window_invite_cb(GtkDialog *dialog, gint response_id,
- G_GNUC_UNUSED gpointer data)
-{
- PidginInviteDialog *invite_dialog = PIDGIN_INVITE_DIALOG(dialog);
- PurpleChatConversation *chat = NULL;
-
- chat = pidgin_invite_dialog_get_conversation(invite_dialog);
-
- g_object_set_data(G_OBJECT(chat), "pidgin-invite-dialog", NULL);
-
- if(response_id == GTK_RESPONSE_ACCEPT) {
- const gchar *contact = NULL, *message = NULL;
-
- contact = pidgin_invite_dialog_get_contact(invite_dialog);
- message = pidgin_invite_dialog_get_message(invite_dialog);
-
- if(!purple_strequal(contact, "")) {
- PurpleConnection *connection = NULL;
-
- connection = purple_conversation_get_connection(PURPLE_CONVERSATION(chat));
- purple_serv_chat_invite(connection,
- purple_chat_conversation_get_id(chat),
- message, contact);
- }
- }
-
- gtk_window_destroy(GTK_WINDOW(invite_dialog));
-}
-
-/******************************************************************************
* Actions
*****************************************************************************/
static void
-pidgin_display_window_alias(G_GNUC_UNUSED GSimpleAction *simple,
- G_GNUC_UNUSED GVariant *parameter,
- gpointer data)
-{
- PidginDisplayWindow *window = data;
- PurpleConversation *selected = NULL;
-
- selected = pidgin_display_window_get_selected(window);
- if(PURPLE_IS_CONVERSATION(selected)) {
- PurpleAccount *account;
- const gchar *name;
-
- account = purple_conversation_get_account(selected);
- name = purple_conversation_get_name(selected);
-
- if(PURPLE_IS_IM_CONVERSATION(selected)) {
- PurpleBuddy *buddy = purple_blist_find_buddy(account, name);
-
- if(PURPLE_IS_BUDDY(buddy)) {
- pidgin_dialogs_alias_buddy(buddy);
- }
- } else if(PURPLE_IS_CHAT_CONVERSATION(selected)) {
- PurpleChat *chat = purple_blist_find_chat(account, name);
-
- if(PURPLE_IS_CHAT(chat)) {
- pidgin_dialogs_alias_chat(chat);
- }
- }
- }
-}
-
-static void
pidgin_display_window_close_conversation(G_GNUC_UNUSED GSimpleAction *simple,
G_GNUC_UNUSED GVariant *parameter,
gpointer data)
@@ -212,39 +147,6 @@
}
static void
-pidgin_display_window_invite(G_GNUC_UNUSED GSimpleAction *simple,
- G_GNUC_UNUSED GVariant *parameter,
- gpointer data)
-{
- PidginDisplayWindow *window = data;
- PurpleConversation *selected = NULL;
-
- selected = pidgin_display_window_get_selected(window);
- if(PURPLE_IS_CHAT_CONVERSATION(selected)) {
- GtkWidget *invite_dialog = NULL;
-
- invite_dialog = g_object_get_data(G_OBJECT(selected),
- "pidgin-invite-dialog");
-
- if(!GTK_IS_WIDGET(invite_dialog)) {
- invite_dialog = pidgin_invite_dialog_new(PURPLE_CHAT_CONVERSATION(selected));
- g_object_set_data(G_OBJECT(selected), "pidgin-invite-dialog",
- invite_dialog);
-
- gtk_window_set_transient_for(GTK_WINDOW(invite_dialog),
- GTK_WINDOW(window));
- gtk_window_set_destroy_with_parent(GTK_WINDOW(invite_dialog), TRUE);
-
- g_signal_connect(invite_dialog, "response",
- G_CALLBACK(pidgin_display_window_invite_cb),
- NULL);
- }
-
- gtk_widget_set_visible(invite_dialog, TRUE);
- }
-}
-
-static void
pidgin_display_window_send_file(G_GNUC_UNUSED GSimpleAction *simple,
G_GNUC_UNUSED GVariant *parameter,
gpointer data)
@@ -265,18 +167,12 @@
static GActionEntry win_entries[] = {
{
- .name = "alias",
- .activate = pidgin_display_window_alias
- }, {
.name = "close",
.activate = pidgin_display_window_close_conversation
}, {
.name = "get-info",
.activate = pidgin_display_window_get_info
}, {
- .name = "invite",
- .activate = pidgin_display_window_invite
- }, {
.name = "send-file",
.activate = pidgin_display_window_send_file
}