pidgin/pidgin

Parents 65c7b6d95868
Children a719f0f3c600
Remove conversation's internal history api as it will be replace by the new history api

Testing Done:
Joined a MUC and verified that that history was still displayed and that sending messages and stuff worked.

Reviewed at https://reviews.imfreedom.org/r/2238/
--- a/ChangeLog.API Mon Feb 20 08:32:47 2023 -0600
+++ b/ChangeLog.API Mon Feb 20 08:33:48 2023 -0600
@@ -479,9 +479,11 @@
* purple_conv_custom_smiley_write
* PurpleConversationType
* purple_conversation_add_smiley
+ * purple_conversation_clear_message_history
* purple_conversation_close_logs
* purple_conversation_do_command
* purple_conversation_get_max_message_size
+ * purple_conversation_get_message_history
* purple_conversation_get_remote_smileys
* purple_conversation_get_smiley
* purple_conversation_is_logging
--- a/finch/gntconv.c Mon Feb 20 08:32:47 2023 -0600
+++ b/finch/gntconv.c Mon Feb 20 08:33:48 2023 -0600
@@ -461,13 +461,6 @@
}
static void
-clear_scrollback_cb(GntMenuItem *item, gpointer ggconv)
-{
- FinchConv *ggc = ggconv;
- purple_conversation_clear_message_history(ggc->active_conv);
-}
-
-static void
send_file_cb(GntMenuItem *item, gpointer ggconv)
{
FinchConv *ggc = ggconv;
@@ -580,10 +573,6 @@
sub = gnt_menu_new(GNT_MENU_POPUP);
gnt_menuitem_set_submenu(item, GNT_MENU(sub));
- item = gnt_menuitem_new(_("Clear Scrollback"));
- gnt_menu_add_item(GNT_MENU(sub), item);
- gnt_menuitem_set_callback(item, clear_scrollback_cb, ggc);
-
item = gnt_menuitem_check_new(_("Show Timestamps"));
gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
purple_prefs_get_bool(PREF_ROOT "/timestamps"));
@@ -1166,15 +1155,6 @@
/* Xerox */
static PurpleCmdRet
-clear_command_cb(PurpleConversation *conv,
- const char *cmd, char **args, char **error, void *data)
-{
- purple_conversation_clear_message_history(conv);
- return PURPLE_CMD_RET_OK;
-}
-
-/* Xerox */
-static PurpleCmdRet
help_command_cb(PurpleConversation *conv,
const char *cmd, char **args, char **error, void *data)
{
@@ -1318,9 +1298,6 @@
purple_cmd_register("debug", "w", PURPLE_CMD_P_DEFAULT,
PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
debug_command_cb, _("debug <option>: Send various debug information to the current conversation."), NULL);
- purple_cmd_register("clear", "", PURPLE_CMD_P_DEFAULT,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
- clear_command_cb, _("clear: Clears the conversation scrollback."), NULL);
purple_cmd_register("help", "w", PURPLE_CMD_P_DEFAULT,
PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, NULL,
help_command_cb, _("help <command>: Help on a specific command."), NULL);
--- a/libpurple/purpleconversation.c Mon Feb 20 08:32:47 2023 -0600
+++ b/libpurple/purpleconversation.c Mon Feb 20 08:33:48 2023 -0600
@@ -48,7 +48,6 @@
PurpleConversationUiOps *ui_ops; /* UI-specific operations. */
PurpleConnectionFlags features; /* The supported features */
- GList *message_history; /* Message history, as a GList of PurpleMessages */
} PurpleConversationPrivate;
enum {
@@ -335,8 +334,6 @@
purple_signal_emit(purple_conversations_get_handle(),
"deleting-conversation", conv);
- purple_conversation_clear_message_history(conv);
-
if(ops != NULL && ops->destroy_conversation != NULL) {
ops->destroy_conversation(conv);
}
@@ -592,7 +589,6 @@
_purple_conversation_write_common(PurpleConversation *conv,
PurpleMessage *pmsg)
{
- PurpleConversationPrivate *priv = NULL;
PurpleProtocol *protocol = NULL;
PurpleConnection *gc = NULL;
PurpleAccount *account;
@@ -604,7 +600,6 @@
g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
g_return_if_fail(pmsg != NULL);
- priv = purple_conversation_get_instance_private(conv);
ops = purple_conversation_get_ui_ops(conv);
account = purple_conversation_get_account(conv);
@@ -691,9 +686,6 @@
}
}
- g_object_ref(pmsg);
- priv->message_history = g_list_prepend(priv->message_history, pmsg);
-
purple_signal_emit(purple_conversations_get_handle(),
(PURPLE_IS_IM_CONVERSATION(conv) ? "wrote-im-msg" : "wrote-chat-msg"),
conv, pmsg);
@@ -842,30 +834,3 @@
return menu;
}
-
-void
-purple_conversation_clear_message_history(PurpleConversation *conv) {
- PurpleConversationPrivate *priv = NULL;
- GList *list;
-
- g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
-
- priv = purple_conversation_get_instance_private(conv);
- list = priv->message_history;
- g_list_free_full(list, g_object_unref);
- priv->message_history = NULL;
-
- purple_signal_emit(purple_conversations_get_handle(),
- "cleared-message-history", conv);
-}
-
-GList *
-purple_conversation_get_message_history(PurpleConversation *conv) {
- PurpleConversationPrivate *priv = NULL;
-
- g_return_val_if_fail(PURPLE_IS_CONVERSATION(conv), NULL);
-
- priv = purple_conversation_get_instance_private(conv);
-
- return priv->message_history;
-}
--- a/libpurple/purpleconversation.h Mon Feb 20 08:32:47 2023 -0600
+++ b/libpurple/purpleconversation.h Mon Feb 20 08:33:48 2023 -0600
@@ -314,27 +314,6 @@
void purple_conversation_update(PurpleConversation *conv, PurpleConversationUpdateType type);
/**
- * purple_conversation_get_message_history:
- * @conv: The conversation
- *
- * Retrieve the message history of a conversation.
- *
- * Returns: (element-type PurpleMessage) (transfer none):
- * A GList of PurpleMessage's. You must not modify the
- * list or the data within. The list contains the newest message at
- * the beginning, and the oldest message at the end.
- */
-GList *purple_conversation_get_message_history(PurpleConversation *conv);
-
-/**
- * purple_conversation_clear_message_history:
- * @conv: The conversation
- *
- * Clear the message history of a conversation.
- */
-void purple_conversation_clear_message_history(PurpleConversation *conv);
-
-/**
* purple_conversation_send_confirm:
* @conv: The conversation.
* @message: The message to send.
--- a/pidgin/pidgincommands.c Mon Feb 20 08:32:47 2023 -0600
+++ b/pidgin/pidgincommands.c Mon Feb 20 08:33:48 2023 -0600
@@ -129,37 +129,6 @@
}
static PurpleCmdRet
-clear_command_cb(PurpleConversation *conv, G_GNUC_UNUSED const char *cmd,
- G_GNUC_UNUSED char **args, G_GNUC_UNUSED char **error,
- G_GNUC_UNUSED gpointer data)
-{
- purple_conversation_clear_message_history(conv);
- return PURPLE_CMD_RET_OK;
-}
-
-static PurpleCmdRet
-clearall_command_cb(G_GNUC_UNUSED PurpleConversation *conv,
- G_GNUC_UNUSED const char *cmd, G_GNUC_UNUSED char **args,
- G_GNUC_UNUSED char **error, G_GNUC_UNUSED gpointer data)
-{
- PurpleConversationManager *manager;
- GList *list;
-
- manager = purple_conversation_manager_get_default();
- list = purple_conversation_manager_get_all(manager);
-
- while(list != NULL) {
- PurpleConversation *conv = PURPLE_CONVERSATION(list->data);
-
- purple_conversation_clear_message_history(conv);
-
- list = g_list_delete_link(list, list);
- }
-
- return PURPLE_CMD_RET_OK;
-}
-
-static PurpleCmdRet
help_command_cb(PurpleConversation *conv, G_GNUC_UNUSED const char *cmd,
char **args, G_GNUC_UNUSED char **error,
G_GNUC_UNUSED gpointer data)
@@ -214,12 +183,6 @@
purple_cmd_register("debug", "w", PURPLE_CMD_P_DEFAULT,
PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
debug_command_cb, _("debug <option>: Send various debug information to the current conversation."), NULL);
- purple_cmd_register("clear", "", PURPLE_CMD_P_DEFAULT,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
- clear_command_cb, _("clear: Clears the conversation scrollback."), NULL);
- purple_cmd_register("clearall", "", PURPLE_CMD_P_DEFAULT,
- PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL,
- clearall_command_cb, _("clearall: Clears all conversation scrollbacks."), NULL);
purple_cmd_register("help", "w", PURPLE_CMD_P_DEFAULT,
PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, NULL,
help_command_cb, _("help <command>: Help on a specific command."), NULL);