pidgin/pidgin

Remove purple_conversation_send_confirm

8 weeks ago, Gary Kramlich
3e35dd3a0b61
Parents 2f998aa86e1a
Children c739a460a784
Remove purple_conversation_send_confirm

I believe this was meant to work with purple-url-handler or something to allow
other applications to send messages, but this just seems like a bad idea across
the board, so we're removing it for now. We can always add something back later
if we determine that a use case justifies that security potential.

Testing Done:
Ran with the turtles.

Reviewed at https://reviews.imfreedom.org/r/3138/
--- a/libpurple/purpleconversation.c Fri Apr 19 16:39:24 2024 -0500
+++ b/libpurple/purpleconversation.c Wed Apr 24 00:58:00 2024 -0500
@@ -301,21 +301,6 @@
g_free(displayed);
}
-static void
-purple_conversation_send_confirm_cb(gpointer *data) {
- PurpleConversation *conversation = data[0];
- char *message = data[1];
-
- g_free(data);
-
- if(!PURPLE_IS_CONVERSATION(conversation)) {
- /* Maybe it was closed before this callback was called. */
- return;
- }
-
- common_send(conversation, message, 0);
-}
-
/**************************************************************************
* Callbacks
**************************************************************************/
@@ -1244,29 +1229,6 @@
return FALSE;
}
-void
-purple_conversation_send_confirm(PurpleConversation *conversation,
- const char *message)
-{
- char *text;
- gpointer *data;
-
- g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
- g_return_if_fail(message != NULL);
-
- text = g_strdup_printf("You are about to send the following message:\n%s",
- message);
- data = g_new0(gpointer, 2);
- data[0] = conversation;
- data[1] = (gpointer)message;
-
- purple_request_action(conversation, NULL, _("Send Message"), text, 0,
- purple_request_cpar_from_account(
- purple_conversation_get_account(conversation)),
- data, 2, _("_Send Message"),
- G_CALLBACK(purple_conversation_send_confirm_cb), _("Cancel"), NULL);
-}
-
gboolean
purple_conversation_get_age_restricted(PurpleConversation *conversation) {
g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
--- a/libpurple/purpleconversation.h Fri Apr 19 16:39:24 2024 -0500
+++ b/libpurple/purpleconversation.h Wed Apr 24 00:58:00 2024 -0500
@@ -391,24 +391,6 @@
gboolean purple_conversation_has_focus(PurpleConversation *conversation);
/**
- * purple_conversation_send_confirm:
- * @conversation: The conversation.
- * @message: The message to send.
- *
- * Sends a message to a conversation after confirming with
- * the user.
- *
- * This function is intended for use in cases where the user
- * hasn't explicitly and knowingly caused a message to be sent.
- * The confirmation ensures that the user isn't sending a
- * message by mistake.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_conversation_send_confirm(PurpleConversation *conversation, const char *message);
-
-/**
* purple_conversation_present_error:
* @who: The user this error is about
* @account: The account this error is on