Fri, 01 Nov 2024 01:13:23 -0500
Remove a bunch of unused api from Purple.ConversationManager
Testing Done:
Called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/3632/
| libpurple/purpleconversationmanager.c | file | annotate | diff | comparison | revisions | |
| libpurple/purpleconversationmanager.h | file | annotate | diff | comparison | revisions |
--- a/libpurple/purpleconversationmanager.c Fri Nov 01 01:06:17 2024 -0500 +++ b/libpurple/purpleconversationmanager.c Fri Nov 01 01:13:23 2024 -0500 @@ -395,33 +395,6 @@ return manager->filename; } -gboolean -purple_conversation_manager_is_registered(PurpleConversationManager *manager, - PurpleConversation *conversation) -{ - g_return_val_if_fail(PURPLE_IS_CONVERSATION_MANAGER(manager), FALSE); - g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE); - - return g_hash_table_contains(manager->conversations, conversation); -} - -void -purple_conversation_manager_foreach(PurpleConversationManager *manager, - PurpleConversationManagerForeachFunc func, - gpointer data) -{ - GHashTableIter iter; - gpointer key; - - g_return_if_fail(PURPLE_IS_CONVERSATION_MANAGER(manager)); - g_return_if_fail(func != NULL); - - g_hash_table_iter_init(&iter, manager->conversations); - while(g_hash_table_iter_next(&iter, &key, NULL)) { - func(PURPLE_CONVERSATION(key), data); - } -} - GList * purple_conversation_manager_get_all(PurpleConversationManager *manager) { g_return_val_if_fail(PURPLE_IS_CONVERSATION_MANAGER(manager), NULL); @@ -429,19 +402,6 @@ return g_hash_table_get_keys(manager->conversations); } - -PurpleConversation * -purple_conversation_manager_find(PurpleConversationManager *manager, - PurpleAccount *account, const gchar *name) -{ - g_return_val_if_fail(PURPLE_IS_CONVERSATION_MANAGER(manager), NULL); - g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); - g_return_val_if_fail(name != NULL, NULL); - - return purple_conversation_manager_find_internal(manager, account, name, - NULL, NULL); -} - PurpleConversation * purple_conversation_manager_find_dm(PurpleConversationManager *manager, PurpleContact *contact)
--- a/libpurple/purpleconversationmanager.h Fri Nov 01 01:06:17 2024 -0500 +++ b/libpurple/purpleconversationmanager.h Fri Nov 01 01:13:23 2024 -0500 @@ -50,19 +50,6 @@ PURPLE, CONVERSATION_MANAGER, GObject) /** - * PurpleConversationManagerForeachFunc: - * @conversation: The #PurpleConversation instance. - * @data: User supplied data. - * - * A function to be used as a callback with - * purple_conversation_manager_foreach(). - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_TYPE_IN_3_0 -typedef void (*PurpleConversationManagerForeachFunc)(PurpleConversation *conversation, gpointer data); - -/** * purple_conversation_manager_add: * @manager: The #PurpleConversationManager instance. * @conversation: The #PurpleConversation to add. @@ -122,41 +109,13 @@ const char *purple_conversation_manager_get_filename(PurpleConversationManager *manager); /** - * purple_conversation_manager_is_registered: - * @manager: The #PurpleConversationManager instance. - * @conversation: The #PurpleConversation instance. - * - * Checks if @conversation is registered with @manager. - * - * Returns: %TRUE if @conversation is registered with @manager, %FALSE - * otherwise. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean purple_conversation_manager_is_registered(PurpleConversationManager *manager, PurpleConversation *conversation); - -/** - * purple_conversation_manager_foreach: - * @manager: The #PurpleConversationManager instance. - * @func: (scope call): The #PurpleConversationManagerForeachFunc to call. - * @data: User data to pass to @func. - * - * Calls @func for each #PurpleConversation that @manager knows about. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_conversation_manager_foreach(PurpleConversationManager *manager, PurpleConversationManagerForeachFunc func, gpointer data); - -/** * purple_conversation_manager_get_all: * @manager: The #PurpleConversationManager instance. * - * Gets a list of all conversations that are registered with @manager. + * Gets a list of all conversations that @manager knows about. * * Returns: (transfer container) (element-type PurpleConversation): A list of - * all of the registered conversations. + * all of the conversations that @manager knows about. * * Since: 3.0 */ @@ -164,22 +123,6 @@ GList *purple_conversation_manager_get_all(PurpleConversationManager *manager); /** - * purple_conversation_manager_find: - * @manager: The #PurpleConversationManager instance. - * @account: The #PurpleAccount instance whose conversation to find. - * @name: The name of the conversation. - * - * Looks for a registered conversation belonging to @account and named @named. - * This function will return the first one matching the given criteria. - * - * Returns: (transfer none): The #PurpleConversation if found, otherwise %NULL. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -PurpleConversation *purple_conversation_manager_find(PurpleConversationManager *manager, PurpleAccount *account, const gchar *name); - -/** * purple_conversation_manager_find_dm: * @manager: The instance. * @contact: The contact. @@ -200,7 +143,7 @@ * @account: The account the conversation belongs to. * @id: The identifier of the conversation. * - * Looks for a registered conversation belonging to @account with an id of @id. + * Looks for a conversation belonging to @account with an id of @id. * * Returns: (transfer none) (nullable): The [class@PurpleConversation] if * found, otherwise %NULL.