pidgin/pidgin

Stop using PurpleIMConversation in Pidgin

2 weeks ago, Gary Kramlich
f555f11df057
Parents a89c5a6dc80b
Children f886f74847b0
Stop using PurpleIMConversation in Pidgin

We're trying to remove PurpleIMConversation so we need to stop using it in
Pidgin. There weren't many uses that were still being called so this was pretty
straight forward.

Testing Done:
Ran with the turtles and dinked around in the app a bit.

Reviewed at https://reviews.imfreedom.org/r/3112/
--- a/pidgin/pidginavatar.c Sat Apr 13 20:58:32 2024 -0500
+++ b/pidgin/pidginavatar.c Sat Apr 13 21:08:59 2024 -0500
@@ -57,15 +57,6 @@
if(PURPLE_IS_BUDDY(avatar->buddy)) {
buddy = PURPLE_BUDDY(avatar->buddy);
-
- } else if(PURPLE_IS_IM_CONVERSATION(avatar->conversation)) {
- PurpleAccount *account = NULL;
- const gchar *name = NULL;
-
- account = purple_conversation_get_account(avatar->conversation);
-
- name = purple_conversation_get_name(avatar->conversation);
- buddy = purple_blist_find_buddy(account, name);
}
return buddy;
--- a/pidgin/pidgindisplaywindow.c Sat Apr 13 20:58:32 2024 -0500
+++ b/pidgin/pidgindisplaywindow.c Sat Apr 13 21:08:59 2024 -0500
@@ -141,33 +141,10 @@
}
}
-static void
-pidgin_display_window_get_info(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)) {
- if(PURPLE_IS_IM_CONVERSATION(selected)) {
- PurpleConnection *connection = NULL;
-
- connection = purple_conversation_get_connection(selected);
- pidgin_retrieve_user_info(connection,
- purple_conversation_get_name(selected));
- }
- }
-}
-
static GActionEntry win_entries[] = {
{
.name = "close",
.activate = pidgin_display_window_close_conversation
- }, {
- .name = "get-info",
- .activate = pidgin_display_window_get_info
}
};
@@ -177,14 +154,7 @@
* A list of action names that are only valid if a conversation is selected.
*/
static const gchar *pidgin_display_window_conversation_actions[] = {
- "alias",
"close",
- "get-info",
- NULL
-};
-
-static const gchar *pidgin_display_window_im_conversation_actions[] = {
- "send-file",
NULL
};
@@ -247,7 +217,6 @@
GtkTreeListRow *row = NULL;
GtkWidget *widget = NULL;
gboolean is_conversation = FALSE;
- gboolean is_im_conversation = FALSE;
row = gtk_single_selection_get_selected_item(selection);
@@ -255,17 +224,11 @@
/* Toggle whether actions should be enabled or disabled. */
conversation = g_object_get_data(G_OBJECT(item), "conversation");
- if(PURPLE_IS_CONVERSATION(conversation)) {
- is_conversation = PURPLE_IS_CONVERSATION(conversation);
- is_im_conversation = PURPLE_IS_IM_CONVERSATION(conversation);
- }
+ is_conversation = PURPLE_IS_CONVERSATION(conversation);
pidgin_display_window_actions_set_enabled(G_ACTION_MAP(window),
pidgin_display_window_conversation_actions,
is_conversation);
- pidgin_display_window_actions_set_enabled(G_ACTION_MAP(window),
- pidgin_display_window_im_conversation_actions,
- is_im_conversation);
widget = pidgin_display_item_get_widget(item);
if(GTK_IS_WIDGET(widget)) {