pidgin/pidgin

Remove PurpleCommandsUiOps

19 months ago, Gary Kramlich
eee8aa10c2a0
Parents aefc93bef426
Children 124c95083fad
Remove PurpleCommandsUiOps

This was initially added for Instantbird which is no longer maintained.

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/1816/
--- a/ChangeLog.API Tue Sep 20 02:55:07 2022 -0500
+++ b/ChangeLog.API Tue Sep 20 03:24:25 2022 -0500
@@ -399,6 +399,9 @@
* purple_certificate_get_fingerprint_sha256
* Purple Cipher API (PurpleCipherContext and friends).
Use GLib's GHmac or GChecksum instead.
+ * PurpleCommandsUiOps
+ * purple_cmds_get_ui_ops
+ * purple_cmds_set_ui_ops
* PURPLE_CMD_FUNC
* purple_connection_error_reason
* PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY
--- a/libpurple/cmds.c Tue Sep 20 02:55:07 2022 -0500
+++ b/libpurple/cmds.c Tue Sep 20 03:24:25 2022 -0500
@@ -20,7 +20,6 @@
#include "purplemarkup.h"
#include "cmds.h"
-static PurpleCommandsUiOps *cmds_ui_ops = NULL;
static GList *cmds = NULL;
static guint next_id = 1;
@@ -49,7 +48,6 @@
{
PurpleCmdId id;
PurpleCmd *c;
- PurpleCommandsUiOps *ops;
g_return_val_if_fail(cmd != NULL && *cmd != '\0', 0);
g_return_val_if_fail(args != NULL, 0);
@@ -70,10 +68,6 @@
cmds = g_list_insert_sorted(cmds, c, (GCompareFunc)cmds_compare_func);
- ops = purple_cmds_get_ui_ops();
- if (ops && ops->register_command)
- ops->register_command(cmd, p, f, protocol_id, helpstr, c->id);
-
purple_signal_emit(purple_cmds_get_handle(), "cmd-added", cmd, p, f);
return id;
@@ -98,7 +92,6 @@
{
PurpleCmd *c;
GList *l;
- PurpleCommandsUiOps *ops;
l = g_list_find_custom(cmds, GUINT_TO_POINTER(id), purple_cmd_cmp_id);
if (!l) {
@@ -107,11 +100,6 @@
c = l->data;
- ops = purple_cmds_get_ui_ops();
- if (ops && ops->unregister_command) {
- ops->unregister_command(c->cmd, c->protocol_id);
- }
-
cmds = g_list_delete_link(cmds, l);
purple_signal_emit(purple_cmds_get_handle(), "cmd-removed", c->cmd);
purple_cmd_free(c);
@@ -388,21 +376,6 @@
return &handle;
}
-void
-purple_cmds_set_ui_ops(PurpleCommandsUiOps *ops)
-{
- cmds_ui_ops = ops;
-}
-
-PurpleCommandsUiOps *
-purple_cmds_get_ui_ops(void)
-{
- /* It is perfectly acceptable for cmds_ui_ops to be NULL; this just
- * means that the default libpurple implementation will be used.
- */
- return cmds_ui_ops;
-}
-
void purple_cmds_init(void)
{
gpointer handle = purple_cmds_get_handle();
--- a/libpurple/cmds.h Tue Sep 20 02:55:07 2022 -0500
+++ b/libpurple/cmds.h Tue Sep 20 03:24:25 2022 -0500
@@ -141,36 +141,6 @@
PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS = 0x08
} PurpleCmdFlag;
-/**
- * PurpleCommandsUiOps:
- * @register_command: If implemented, the UI is responsible for handling
- * commands. See @purple_cmd_register for the argument values.
- * @unregister_command: Should be implemented if register_command is
- * implemented. @name and @prpl_id will have the same value
- * that were used for the register_command call.
- *
- * Command UI operations; UIs should implement this if they want to handle
- * commands themselves, rather than relying on the core.
- *
- * See <link linkend="chapter-ui-ops">List of <literal>UiOps</literal>
- * Structures</link>
- *
- * Since: 2.11.0
- */
-typedef struct {
- void (*register_command)(const gchar *name, PurpleCmdPriority priority,
- PurpleCmdFlag flags, const gchar *prpl_id,
- const gchar *help, PurpleCmdId id);
-
- void (*unregister_command)(const gchar *name, const gchar *prpl_id);
-
- /*< private >*/
- void (*_purple_reserved1)(void);
- void (*_purple_reserved2)(void);
- void (*_purple_reserved3)(void);
- void (*_purple_reserved4)(void);
-} PurpleCommandsUiOps;
-
G_BEGIN_DECLS
/**************************************************************************/
@@ -327,26 +297,6 @@
gpointer purple_cmds_get_handle(void);
/**
- * purple_cmds_set_ui_ops:
- * @ops: The UI operations structure.
- *
- * Sets the UI operations structure to be used when registering and
- * unregistering commands. The UI operations need only be set if the
- * UI wants to handle the commands itself; otherwise, leave it as NULL.
- */
-void purple_cmds_set_ui_ops(PurpleCommandsUiOps *ops);
-
-/**
- * purple_cmds_get_ui_ops:
- *
- * Returns the UI operations structure to be used when registering and
- * unregistering commands.
- *
- * Returns: (transfer none): The UI operations structure.
- */
-PurpleCommandsUiOps *purple_cmds_get_ui_ops(void);
-
-/**
* purple_cmds_init:
*
* Initialize the commands subsystem.