qulogic/pidgin

Parents e868bfcc092a
Children 7bde7363e0f3
Remove some left over code for enabling and disabling actions that is no longer necessary

When we removed the unused menu items we missed removing the logic for toggling
whether or not actions that required the PurpleProtocolChat interface. This
just deletes that code.

Testing Done:
Compiled, ran, and verified that the warning about the unknown action was gone.

Reviewed at https://reviews.imfreedom.org/r/2904/
--- a/pidgin/pidginapplication.c Sun Dec 31 21:56:51 2023 -0600
+++ b/pidgin/pidginapplication.c Sun Dec 31 21:59:37 2023 -0600
@@ -224,16 +224,6 @@
};
/*< private >
- * pidgin_application_chat_actions:
- *
- * This list keeps track of which actions should only be enabled if a protocol
- * supporting groups chats is connected.
- */
-static const gchar *pidgin_application_chat_actions[] = {
- "join-chat",
-};
-
-/*< private >
* pidgin_application_room_list_actions:
*
* This list keeps track of which actions should only be enabled if an online
@@ -600,7 +590,6 @@
PidginApplication *application = data;
PurpleProtocol *protocol = NULL;
gboolean should_enable_channel = FALSE;
- gboolean should_enable_chat = FALSE;
gboolean should_enable_room_list = FALSE;
guint n_actions = 0;
@@ -614,18 +603,9 @@
protocol = purple_account_get_protocol(account);
/* We assume that the current state is correct, so we don't bother changing
- * state unless the newly connected account implements the chat interface,
- * which would cause a state change.
+ * state unless the newly connected account implements the channel virtual
+ * functions, which would cause a state change.
*/
- should_enable_chat = PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info);
- if(should_enable_chat) {
- n_actions = G_N_ELEMENTS(pidgin_application_chat_actions);
- pidgin_application_actions_set_enabled(application,
- pidgin_application_chat_actions,
- n_actions,
- TRUE);
- }
-
should_enable_channel = PURPLE_PROTOCOL_IMPLEMENTS(protocol, CONVERSATION,
get_channel_join_details);
if(should_enable_channel) {
@@ -658,7 +638,6 @@
PidginApplication *application = data;
GList *connected = NULL;
gboolean should_disable_actions = TRUE;
- gboolean should_disable_chat = TRUE;
gboolean should_disable_channel = TRUE;
gboolean should_disable_room_list = TRUE;
guint n_actions = 0;
@@ -674,11 +653,6 @@
protocol = purple_account_get_protocol(account);
- /* Check if the protocol implements the chat interface. */
- if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info)) {
- should_disable_chat = FALSE;
- }
-
/* Check if the protocol implements joining channels. */
if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, CONVERSATION,
get_channel_join_details))
@@ -692,9 +666,7 @@
}
/* If we can't disable anything we can exit the loop early. */
- if(!should_disable_chat && !should_disable_channel &&
- !should_disable_room_list)
- {
+ if(!should_disable_channel && !should_disable_room_list) {
g_clear_list(&connected, NULL);
break;
@@ -711,14 +683,6 @@
FALSE);
}
- if(should_disable_chat) {
- n_actions = G_N_ELEMENTS(pidgin_application_chat_actions);
- pidgin_application_actions_set_enabled(application,
- pidgin_application_chat_actions,
- n_actions,
- FALSE);
- }
-
if(should_disable_channel) {
n_actions = G_N_ELEMENTS(pidgin_application_channel_actions);
pidgin_application_actions_set_enabled(application,
@@ -988,12 +952,6 @@
n_actions,
online);
- n_actions = G_N_ELEMENTS(pidgin_application_chat_actions);
- pidgin_application_actions_set_enabled(application,
- pidgin_application_chat_actions,
- n_actions,
- online);
-
n_actions = G_N_ELEMENTS(pidgin_application_channel_actions);
pidgin_application_actions_set_enabled(application,
pidgin_application_channel_actions,