--- a/ChangeLog.API Sat Apr 13 22:24:47 2024 -0500
+++ b/ChangeLog.API Sat Apr 13 22:28:40 2024 -0500
@@ -681,15 +681,30 @@
* purple_request_fields_get_autosensitive
* purple_request_fields_get_ui_data
* purple_request_fields_set_ui_data
+ * PurpleRoomlistFieldType + * purple_roomlist_cancel_get_list * purple_roomlist_expand_category
* purple_roomlist_field_get_field_type
* purple_roomlist_field_get_hidden
* purple_roomlist_field_get_label
* purple_roomlist_field_new
* purple_roomlist_get_fields
+ * purple_roomlist_get_in_progress + * purple_roomlist_get_list * purple_roomlist_get_protocol_data
+ * purple_roomlist_get_ui_ops + * purple_roomlist_room_add + * purple_roomlist_room_get_name + * purple_roomlist_set_fields + * purple_roomlist_set_in_progress * purple_roomlist_set_protocol_data
+ * purple_roomlist_set_ui_ops + * purple_roomlist_show_with_account --- a/libpurple/meson.build Sat Apr 13 22:24:47 2024 -0500
+++ b/libpurple/meson.build Sat Apr 13 22:28:40 2024 -0500
@@ -76,12 +76,10 @@
'purpleprotocolfiletransfer.c',
'purpleprotocolmanager.c',
- 'purpleprotocolroomlist.c',
'purpleprotocolroster.c',
'purpleprotocolserver.c',
'purpleprotocolwhiteboard.c',
- 'purpleroomlistroom.c',
'purplesqlitehistoryadapter.c',
@@ -105,7 +103,6 @@
'request/purplerequestgroup.c',
'request/purplerequestpage.c',
@@ -187,12 +184,10 @@
'purpleprotocolfiletransfer.h',
'purpleprotocolmanager.h',
- 'purpleprotocolroomlist.h',
'purpleprotocolroster.h',
'purpleprotocolserver.h',
'purpleprotocolwhiteboard.h',
- 'purpleroomlistroom.h',
'purplesqlitehistoryadapter.h',
@@ -206,7 +201,6 @@
'purplewhiteboarduiops.h',
@@ -293,7 +287,6 @@
--- a/libpurple/purpleprotocolroomlist.c Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#include "purpleprotocolroomlist.h"
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-G_DEFINE_INTERFACE(PurpleProtocolRoomlist, purple_protocol_roomlist,
-purple_protocol_roomlist_default_init(G_GNUC_UNUSED PurpleProtocolRoomlistInterface *iface)
-/******************************************************************************
- *****************************************************************************/
-purple_protocol_roomlist_get_list(PurpleProtocolRoomlist *protocol_roomlist,
- PurpleProtocolRoomlistInterface *iface = NULL;
- g_return_val_if_fail(PURPLE_IS_PROTOCOL_ROOMLIST(protocol_roomlist), NULL);
- g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
- iface = PURPLE_PROTOCOL_ROOMLIST_GET_IFACE(protocol_roomlist);
- if(iface != NULL && iface->get_list != NULL) {
- return iface->get_list(protocol_roomlist, gc);
-purple_protocol_roomlist_cancel(PurpleProtocolRoomlist *protocol_roomlist,
- PurpleProtocolRoomlistInterface *iface = NULL;
- g_return_if_fail(PURPLE_IS_PROTOCOL_ROOMLIST(protocol_roomlist));
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- iface = PURPLE_PROTOCOL_ROOMLIST_GET_IFACE(protocol_roomlist);
- if(iface != NULL && iface->cancel != NULL) {
- iface->cancel(protocol_roomlist, list);
-purple_protocol_roomlist_expand_category(PurpleProtocolRoomlist *protocol_roomlist,
- PurpleRoomlistRoom *category)
- PurpleProtocolRoomlistInterface *iface = NULL;
- g_return_if_fail(PURPLE_IS_PROTOCOL_ROOMLIST(protocol_roomlist));
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- iface = PURPLE_PROTOCOL_ROOMLIST_GET_IFACE(protocol_roomlist);
- if(iface != NULL && iface->expand_category != NULL) {
- iface->expand_category(protocol_roomlist, list, category);
-purple_protocol_roomlist_room_serialize(PurpleProtocolRoomlist *protocol_roomlist,
- PurpleRoomlistRoom *room)
- PurpleProtocolRoomlistInterface *iface = NULL;
- g_return_val_if_fail(PURPLE_IS_PROTOCOL_ROOMLIST(protocol_roomlist), NULL);
- g_return_val_if_fail(room != NULL, NULL);
- iface = PURPLE_PROTOCOL_ROOMLIST_GET_IFACE(protocol_roomlist);
- if(iface != NULL && iface->room_serialize != NULL) {
- return iface->room_serialize(protocol_roomlist, room);
--- a/libpurple/purpleprotocolroomlist.h Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_PROTOCOL_ROOMLIST_H
-#define PURPLE_PROTOCOL_ROOMLIST_H
-#include "purpleprotocol.h"
-#include "purpleversion.h"
-#define PURPLE_TYPE_PROTOCOL_ROOMLIST (purple_protocol_roomlist_get_type())
-G_DECLARE_INTERFACE(PurpleProtocolRoomlist, purple_protocol_roomlist, PURPLE,
- PROTOCOL_ROOMLIST, PurpleProtocol)
- * PurpleProtocolRoomlist:
- * The protocol roomlist interface.
- * #PurpleProtocolRoomlist is an interface to abstract how to handle room
- * lists at the protocol level.
-struct _PurpleProtocolRoomlistInterface {
- GTypeInterface parent_iface;
- PurpleRoomlist *(*get_list)(PurpleProtocolRoomlist *protocol_roomlist, PurpleConnection *gc);
- void (*cancel)(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlist *list);
- void (*expand_category)(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlist *list, PurpleRoomlistRoom *category);
- gchar *(*room_serialize)(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlistRoom *room);
- * purple_protocol_roomlist_get_list:
- * @protocol_roomlist: The #PurpleProtocolRoomlist instance.
- * @gc: The #PurpleAccount to get the roomlist for.
- * Gets the list of rooms for @gc.
- * Returns: (transfer full): The roomlist for @gc.
-PurpleRoomlist *purple_protocol_roomlist_get_list(PurpleProtocolRoomlist *protocol_roomlist, PurpleConnection *gc);
- * purple_protocol_roomlist_cancel:
- * @protocol_roomlist: The #PurpleProtocolRoomlist instance.
- * @list: The #PurpleRoomlist instance.
- * Requesting a roomlist can take a long time. This function cancels a request
- * that's already in progress.
-void purple_protocol_roomlist_cancel(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlist *list);
- * purple_protocol_roomlist_expand_category:
- * @protocol_roomlist: The #PurpleProtocolRoomlist instance.
- * @list: The #PurpleRoomlist instance.
- * @category: The category to expand.
- * Expands the given @category for @list.
-void purple_protocol_roomlist_expand_category(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlist *list, PurpleRoomlistRoom *category);
- * purple_protocol_roomlist_room_serialize:
- * @protocol_roomlist: The #PurpleProtocolRoomlist instance.
- * @room: The #PurpleRoomlistRoom instance.
- * Serializes @room into a string that will be displayed in a user interface.
- * Returns: (transfer full): The serialized form of @room.
-char *purple_protocol_roomlist_room_serialize(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlistRoom *room);
-#endif /* PURPLE_PROTOCOL_ROOMLIST_H */
--- a/libpurple/purpleroomlistroom.c Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#include "purpleroomlistroom.h"
- GHashTable *components;
-} PurpleRoomlistRoomPrivate;
-static GParamSpec *properties[N_PROPERTIES] = {NULL, };
-G_DEFINE_TYPE_WITH_PRIVATE(PurpleRoomlistRoom, purple_roomlist_room,
-/******************************************************************************
- *****************************************************************************/
-purple_roomlist_room_set_name(PurpleRoomlistRoom *room, const gchar *name) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- priv = purple_roomlist_room_get_instance_private(room);
- g_clear_pointer(&priv->name, g_free);
- priv->name = g_strdup(name);
- g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_NAME]);
-purple_roomlist_room_set_description(PurpleRoomlistRoom *room,
- const gchar *description)
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- priv = purple_roomlist_room_get_instance_private(room);
- g_clear_pointer(&priv->description, g_free);
- priv->description = g_strdup(description);
- g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_DESCRIPTION]);
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-purple_roomlist_room_get_property(GObject *obj, guint param_id, GValue *value,
- PurpleRoomlistRoom *room = PURPLE_ROOMLIST_ROOM(obj);
- g_value_set_string(value, purple_roomlist_room_get_name(room));
- g_value_set_string(value,
- purple_roomlist_room_get_description(room));
- g_value_set_string(value, purple_roomlist_room_get_category(room));
- g_value_set_uint(value, purple_roomlist_room_get_user_count(room));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-purple_roomlist_room_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
- PurpleRoomlistRoom *room = PURPLE_ROOMLIST_ROOM(obj);
- purple_roomlist_room_set_name(room, g_value_get_string(value));
- purple_roomlist_room_set_description(room,
- g_value_get_string(value));
- purple_roomlist_room_set_category(room, g_value_get_string(value));
- purple_roomlist_room_set_user_count(room, g_value_get_uint(value));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-purple_roomlist_room_finalize(GObject *obj) {
- PurpleRoomlistRoom *room = NULL;
- PurpleRoomlistRoomPrivate *priv = NULL;;
- room = PURPLE_ROOMLIST_ROOM(obj);
- priv = purple_roomlist_room_get_instance_private(room);
- g_clear_pointer(&priv->name, g_free);
- g_clear_pointer(&priv->description, g_free);
- g_clear_pointer(&priv->category, g_free);
- g_clear_pointer(&priv->components, g_hash_table_destroy);
- G_OBJECT_CLASS(purple_roomlist_room_parent_class)->finalize(obj);
-purple_roomlist_room_init(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- priv = purple_roomlist_room_get_instance_private(room);
- priv->components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
-purple_roomlist_room_class_init(PurpleRoomlistRoomClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- obj_class->get_property = purple_roomlist_room_get_property;
- obj_class->set_property = purple_roomlist_room_set_property;
- obj_class->finalize = purple_roomlist_room_finalize;
- * PurpleRoomlistRoom:name:
- * The name of the room.
- properties[PROP_NAME] = g_param_spec_string(
- "The name of the room",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- * PurpleRoomlistRoom:description:
- * The description of the room.
- properties[PROP_DESCRIPTION] = g_param_spec_string(
- "description", "description",
- "The description of the room",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- * PurpleRoomlistRoom:category:
- * The category of the room.
- properties[PROP_CATEGORY] = g_param_spec_string(
- "category", "category",
- "The category of the room",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- * PurpleRoomlistRoom:user-count:
- * The number of users in the room.
- properties[PROP_USER_COUNT] = g_param_spec_uint(
- "user-count", "user-count",
- "The user count of the room",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
-/******************************************************************************
- *****************************************************************************/
-purple_roomlist_room_new(const gchar *name, const gchar *description) {
- PURPLE_TYPE_ROOMLIST_ROOM,
- "description", description,
-purple_roomlist_room_get_name(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
- priv = purple_roomlist_room_get_instance_private(room);
-purple_roomlist_room_get_description(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
- priv = purple_roomlist_room_get_instance_private(room);
- return priv->description;
-purple_roomlist_room_get_category(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
- priv = purple_roomlist_room_get_instance_private(room);
-purple_roomlist_room_set_category(PurpleRoomlistRoom *room,
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- priv = purple_roomlist_room_get_instance_private(room);
- g_clear_pointer(&priv->category, g_free);
- priv->category = g_strdup(category);
- g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_CATEGORY]);
-purple_roomlist_room_get_user_count(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), 0);
- priv = purple_roomlist_room_get_instance_private(room);
- return priv->user_count;
-purple_roomlist_room_set_user_count(PurpleRoomlistRoom *room,
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- priv = purple_roomlist_room_get_instance_private(room);
- priv->user_count = user_count;
- g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_USER_COUNT]);
-purple_roomlist_room_add_field(PurpleRoomlistRoom *room, const gchar *field,
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- g_return_if_fail(field != NULL);
- g_return_if_fail(value != NULL);
- priv = purple_roomlist_room_get_instance_private(room);
- g_hash_table_replace(priv->components, (gpointer)field, g_strdup(value));
-purple_roomlist_room_get_field(PurpleRoomlistRoom *room, const gchar *field) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
- g_return_val_if_fail(field != NULL, NULL);
- priv = purple_roomlist_room_get_instance_private(room);
- return g_hash_table_lookup(priv->components, field);
-purple_roomlist_room_get_components(PurpleRoomlistRoom *room) {
- PurpleRoomlistRoomPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
- priv = purple_roomlist_room_get_instance_private(room);
- return priv->components;
--- a/libpurple/purpleroomlistroom.h Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_ROOMLIST_ROOM_H
-#define PURPLE_ROOMLIST_ROOM_H
-#include <glib-object.h>
-#include "purpleversion.h"
-#define PURPLE_TYPE_ROOMLIST_ROOM (purple_roomlist_room_get_type())
- * purple_roomlist_room_get_type:
- * Gets the #GType of #PurpleRoomlistRoom.
- * Returns: The #GType of #PurpleRoomlistRoom.
- * #PurpleRoomlistRoom keeps track of all #PurpleConversation's inside
- * of libpurple and allows searching of them.
-G_DECLARE_DERIVABLE_TYPE(PurpleRoomlistRoom, purple_roomlist_room, PURPLE,
- ROOMLIST_ROOM, GObject)
-struct _PurpleRoomlistRoomClass {
- * purple_roomlist_room_new:
- * @name: The name for the room.
- * @description: The description or topic of the room.
- * Creates a new room to be added to a [class@Purple.Roomlist].
- * Returns: (transfer full): The new room.
-PurpleRoomlistRoom *purple_roomlist_room_new(const gchar *name, const gchar *description);
- * purple_roomlist_room_get_name:
- * Gets the name of @room.
- * Returns: The name of @room.
-const gchar *purple_roomlist_room_get_name(PurpleRoomlistRoom *room);
- * purple_roomlist_room_get_description:
- * Gets the description of @room.
- * Returns: The description of @room.
-const gchar *purple_roomlist_room_get_description(PurpleRoomlistRoom *room);
- * purple_roomlist_room_get_category:
- * Gets the category of @room. It is up to the user interface on whether or not
- * Returns: The category of @room if set otherwise %NULL.
-const gchar *purple_roomlist_room_get_category(PurpleRoomlistRoom *room);
- * purple_roomlist_room_set_category:
- * @category: (nullable): The new category.
- * Sets the category of @room.
-void purple_roomlist_room_set_category(PurpleRoomlistRoom *room, const gchar *category);
- * purple_roomlist_room_get_user_count:
- * Gets the number of users in @room.
- * Returns: The number of users in @room if set, otherwise 0.
-guint purple_roomlist_room_get_user_count(PurpleRoomlistRoom *room);
- * purple_roomlist_room_set_user_count:
- * @user_count: The new user count.
- * Sets the user count of @room to @user_count.
-void purple_roomlist_room_set_user_count(PurpleRoomlistRoom *room, guint user_count);
- * purple_roomlist_room_add_field:
- * @room: This instance.
- * @field: The name of the field. This should be a static string.
- * @value: The value of the field. This should be a copy of the value.
- * Adds a new field to @room with the name of @field and value of @value.
-void purple_roomlist_room_add_field(PurpleRoomlistRoom *room, const gchar *field, const gchar *value);
- * purple_roomlist_room_get_field:
- * @field: The name of the field to get.
- * Gets the value of the field named @field in @room.
- * Returns: The value of @field.
-const gchar *purple_roomlist_room_get_field(PurpleRoomlistRoom *room, const gchar *field);
- * purple_roomlist_room_get_components:
- * Gets the components that can be passed to purple_serv_join_chat() to join
- * Returns: (transfer none): The components used to join the room.
-GHashTable *purple_roomlist_room_get_components(PurpleRoomlistRoom *room);
-#endif /* PURPLE_ROOMLIST_ROOM_H */
--- a/libpurple/roomlist.c Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,356 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#include "purpleaccount.h"
-/* This must be after roomlist.h otherwise you'll get an include cycle. */
-#include "purpleprotocolroomlist.h"
- * Private data for a room list.
- PurpleAccount *account; /* The account this list belongs to. */
- GList *rooms; /* The list of rooms. */
- gboolean in_progress; /* The listing is in progress. */
-} PurpleRoomlistPrivate;
-/* Room list property enums */
-static GParamSpec *properties[N_PROPERTIES] = {NULL, };
-static PurpleRoomlistUiOps *ops = NULL;
-G_DEFINE_FINAL_TYPE_WITH_PRIVATE(PurpleRoomlist, purple_roomlist,
-/**************************************************************************/
-/**************************************************************************/
-void purple_roomlist_show_with_account(PurpleAccount *account)
- if (ops && ops->show_with_account)
- ops->show_with_account(account);
-PurpleAccount *purple_roomlist_get_account(PurpleRoomlist *list)
- PurpleRoomlistPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST(list), NULL);
- priv = purple_roomlist_get_instance_private(list);
-void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress)
- PurpleRoomlistPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- priv = purple_roomlist_get_instance_private(list);
- priv->in_progress = in_progress;
- g_object_notify_by_pspec(G_OBJECT(list), properties[PROP_IN_PROGRESS]);
-gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list)
- PurpleRoomlistPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_ROOMLIST(list), FALSE);
- priv = purple_roomlist_get_instance_private(list);
- return priv->in_progress;
-void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room)
- PurpleRoomlistPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- g_return_if_fail(room != NULL);
- priv = purple_roomlist_get_instance_private(list);
- priv->rooms = g_list_append(priv->rooms, room);
- if (ops && ops->add_room)
- ops->add_room(list, room);
-PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc)
- PurpleProtocol *protocol = NULL;
- g_return_val_if_fail(PURPLE_IS_CONNECTION(gc), NULL);
- g_return_val_if_fail(PURPLE_CONNECTION_IS_CONNECTED(gc), NULL);
- protocol = purple_connection_get_protocol(gc);
- if(PURPLE_IS_PROTOCOL_ROOMLIST(protocol)) {
- return purple_protocol_roomlist_get_list(PURPLE_PROTOCOL_ROOMLIST(protocol),
-void purple_roomlist_cancel_get_list(PurpleRoomlist *list)
- PurpleRoomlistPrivate *priv = NULL;
- PurpleProtocol *protocol = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- priv = purple_roomlist_get_instance_private(list);
- gc = purple_account_get_connection(priv->account);
- g_return_if_fail(PURPLE_IS_CONNECTION(gc));
- protocol = purple_connection_get_protocol(gc);
- if(PURPLE_IS_PROTOCOL_ROOMLIST(protocol)) {
- purple_protocol_roomlist_cancel(PURPLE_PROTOCOL_ROOMLIST(protocol), list);
-purple_roomlist_join_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) {
- PurpleRoomlistPrivate *priv = NULL;
- PurpleConnection *connection = NULL;
- GHashTable *components = NULL, *adjusted = NULL;
- const gchar *name = NULL;
- g_return_if_fail(PURPLE_IS_ROOMLIST(list));
- g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
- priv = purple_roomlist_get_instance_private(list);
- connection = purple_account_get_connection(priv->account);
- if(connection == NULL) {
- components = purple_roomlist_room_get_components(room);
- /* Make a copy of the components as we make sure the name is included. */
- adjusted = g_hash_table_new(g_str_hash, g_str_equal);
- g_hash_table_iter_init(&iter, components);
- while(g_hash_table_iter_next(&iter, &key, &value)) {
- g_hash_table_insert(adjusted, key, value);
- name = purple_roomlist_room_get_name(room);
- g_hash_table_replace(adjusted, "name", (gpointer)name);
- /* purple_serv_join_chat(connection, adjusted); */
- g_hash_table_destroy(adjusted);
-/**************************************************************************/
-/* Room List GObject code */
-/**************************************************************************/
-/* Set method for GObject properties */
-purple_roomlist_set_property(GObject *obj, guint param_id, const GValue *value,
- PurpleRoomlist *list = PURPLE_ROOMLIST(obj);
- PurpleRoomlistPrivate *priv =
- purple_roomlist_get_instance_private(list);
- priv->account = g_value_get_object(value);
- purple_roomlist_set_in_progress(list, g_value_get_boolean(value));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-/* Get method for GObject properties */
-purple_roomlist_get_property(GObject *obj, guint param_id, GValue *value,
- PurpleRoomlist *list = PURPLE_ROOMLIST(obj);
- g_value_set_object(value, purple_roomlist_get_account(list));
- g_value_set_boolean(value, purple_roomlist_get_in_progress(list));
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-purple_roomlist_init(G_GNUC_UNUSED PurpleRoomlist *list)
-/* Called when done constructing */
-purple_roomlist_constructed(GObject *object)
- PurpleRoomlist *list = PURPLE_ROOMLIST(object);
- G_OBJECT_CLASS(purple_roomlist_parent_class)->constructed(object);
- if (ops && ops->create)
-/* GObject finalize function */
-purple_roomlist_finalize(GObject *object)
- PurpleRoomlist *list = PURPLE_ROOMLIST(object);
- PurpleRoomlistPrivate *priv =
- purple_roomlist_get_instance_private(list);
- purple_debug_misc("roomlist", "destroying list %p\n", list);
- g_list_free_full(priv->rooms, g_object_unref);
- G_OBJECT_CLASS(purple_roomlist_parent_class)->finalize(object);
-/* Class initializer function */
-purple_roomlist_class_init(PurpleRoomlistClass *klass)
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- obj_class->finalize = purple_roomlist_finalize;
- obj_class->constructed = purple_roomlist_constructed;
- obj_class->get_property = purple_roomlist_get_property;
- obj_class->set_property = purple_roomlist_set_property;
- * PurpleRoomlist:account:
- * The account this room list belongs to.
- properties[PROP_ACCOUNT] = g_param_spec_object("account", "Account",
- "The account for the room list.",
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS);
- * PurpleRoomlist:in-progress:
- * Whether or not the room list is being fetched.
- properties[PROP_IN_PROGRESS] = g_param_spec_boolean("in-progress",
- "Whether the room list is being fetched.", FALSE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
-PurpleRoomlist *purple_roomlist_new(PurpleAccount *account)
- return g_object_new(PURPLE_TYPE_ROOMLIST,
-/**************************************************************************/
-/* UI Registration Functions */
-/**************************************************************************/
-void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ui_ops)
-PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void)
-/**************************************************************************
- **************************************************************************/
-static PurpleRoomlistUiOps *
-purple_roomlist_ui_ops_copy(PurpleRoomlistUiOps *ops)
- PurpleRoomlistUiOps *ops_new;
- g_return_val_if_fail(ops != NULL, NULL);
- ops_new = g_new(PurpleRoomlistUiOps, 1);
-purple_roomlist_ui_ops_get_type(void)
- type = g_boxed_type_register_static("PurpleRoomlistUiOps",
- (GBoxedCopyFunc)purple_roomlist_ui_ops_copy,
- (GBoxedFreeFunc)g_free);
--- a/libpurple/roomlist.h Sat Apr 13 22:24:47 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#ifndef PURPLE_ROOMLIST_H
-#define PURPLE_ROOMLIST_H
-#include "purpleversion.h"
-#define PURPLE_TYPE_ROOMLIST (purple_roomlist_get_type())
-typedef struct _PurpleRoomlist PurpleRoomlist;
- * A field for the room list.
-#define PURPLE_TYPE_ROOMLIST_FIELD (purple_roomlist_field_get_type())
-typedef struct _PurpleRoomlistField PurpleRoomlistField;
-#define PURPLE_TYPE_ROOMLIST_UI_OPS (purple_roomlist_ui_ops_get_type())
-typedef struct _PurpleRoomlistUiOps PurpleRoomlistUiOps;
- * PurpleRoomlistFieldType:
- * @PURPLE_ROOMLIST_FIELD_BOOL: The field is a boolean.
- * @PURPLE_ROOMLIST_FIELD_INT: The field is an integer.
- * @PURPLE_ROOMLIST_FIELD_STRING: We do a g_strdup on the passed value if it's
- PURPLE_ROOMLIST_FIELD_BOOL,
- PURPLE_ROOMLIST_FIELD_INT,
- PURPLE_ROOMLIST_FIELD_STRING
-} PurpleRoomlistFieldType;
-#include "purpleaccount.h"
-#include "purpleroomlistroom.h"
-/**************************************************************************/
-/**************************************************************************/
- * @show_with_account: Force the ui to pop up a dialog and get the list.
- * @create: A new list was created.
- * @set_fields: Sets the columns.
- * @add_room: Add a room to the list.
- * The room list ops to be filled out by the UI.
-struct _PurpleRoomlistUiOps {
- void (*show_with_account)(PurpleAccount *account);
- void (*create)(PurpleRoomlist *list);
- void (*set_fields)(PurpleRoomlist *list, GList *fields);
- void (*add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room);
- void (*_purple_reserved1)(void);
- void (*_purple_reserved2)(void);
- void (*_purple_reserved3)(void);
- void (*_purple_reserved4)(void);
- * Represents a list of rooms for a given connection on a given protocol.
-struct _PurpleRoomlist {
-/**************************************************************************/
-/**************************************************************************/
- * purple_roomlist_get_type:
- * The standard _get_type function for #PurpleRoomlist.
- * Returns: The #GType for the Room List object.
-G_DECLARE_FINAL_TYPE(PurpleRoomlist, purple_roomlist, PURPLE, ROOMLIST, GObject)
- * purple_roomlist_show_with_account:
- * @account: The account to get the list on.
- * This is used to get the room list on an account, asking the UI
- * to pop up a dialog with the specified account already selected,
- * and pretend the user clicked the get list button.
- * While we're pretending, predend I didn't say anything about dialogs
- * or buttons, since this is the core.
-void purple_roomlist_show_with_account(PurpleAccount *account);
- * @account: The account that's listing rooms.
- * Returns a newly created room list object.
- * Returns: The new room list handle.
-PurpleRoomlist *purple_roomlist_new(PurpleAccount *account);
- * purple_roomlist_get_account:
- * @list: The room list.
- * Retrieve the PurpleAccount that was given when the room list was
- * Returns: (transfer none): The PurpleAccount tied to this room list.
-PurpleAccount *purple_roomlist_get_account(PurpleRoomlist *list);
- * purple_roomlist_set_fields:
- * @list: The room list.
- * @fields: (element-type PurpleRoomlistField) (transfer full): UI's are
- * encouraged to default to displaying these fields in the order given.
- * Set the different field types and their names for this protocol.
- * This must be called before purple_roomlist_room_add().
-void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields);
- * purple_roomlist_set_in_progress:
- * @list: The room list.
- * @in_progress: We're downloading it, or we're not.
- * Set the "in progress" state of the room list.
- * The UI is encouraged to somehow hint to the user
- * whether or not we're busy downloading a room list or not.
-void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress);
- * purple_roomlist_get_in_progress:
- * @list: The room list.
- * Gets the "in progress" state of the room list.
- * The UI is encouraged to somehow hint to the user
- * whether or not we're busy downloading a room list or not.
- * Returns: True if we're downloading it, or false if we're not.
-gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list);
- * purple_roomlist_room_add:
- * @list: The room list.
- * @room: The room to add to the list. The GList of fields must be in the same
- order as was given in purple_roomlist_set_fields().
- * Adds a room to the list of them.
-void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room);
- * purple_roomlist_get_list:
- * @gc: The PurpleConnection to have get a list.
- * Returns a PurpleRoomlist structure from the protocol, and
- * instructs the protocol to start fetching the list.
- * Returns: (transfer full): A PurpleRoomlist* or %NULL if the protocol doesn't
-PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc);
- * purple_roomlist_cancel_get_list:
- * @list: The room list to cancel a get_list on.
- * Tells the protocol to stop fetching the list.
- * If this is possible and done, the protocol will
- * call set_in_progress with %FALSE and possibly
- * unref the list if it took a reference.
-void purple_roomlist_cancel_get_list(PurpleRoomlist *list);
- * purple_roomlist_join_room:
- * @list: The room list whose room to join.
- * @room: The room to join.
- * Create a new conversation for @room.
-void purple_roomlist_join_room(PurpleRoomlist *list, PurpleRoomlistRoom *room);
-/**************************************************************************/
-/* UI Registration Functions */
-/**************************************************************************/
- * purple_roomlist_ui_ops_get_type:
- * The standard _get_type function for #PurpleRoomlistUiOps.
- * Returns: The #GType for the #PurpleRoomlistUiOps boxed structure.
-GType purple_roomlist_ui_ops_get_type(void);
- * purple_roomlist_set_ui_ops:
- * @ops: The UI operations structure.
- * Sets the UI operations structure to be used in all purple room lists.
-void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ops);
- * purple_roomlist_get_ui_ops:
- * Returns the purple window UI operations structure to be used in
- * Returns: A filled-out PurpleRoomlistUiOps structure.
-PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void);
-#endif /* PURPLE_ROOMLIST_H */
--- a/po/POTFILES.in Sat Apr 13 22:24:47 2024 -0500
+++ b/po/POTFILES.in Sat Apr 13 22:28:40 2024 -0500
@@ -67,7 +67,6 @@
libpurple/purpleprotocolclient.c
libpurple/purpleprotocolmanager.c
libpurple/purpleprotocolmedia.c
-libpurple/purpleprotocolroomlist.c
libpurple/purpleprotocolserver.c
libpurple/purpleprotocolwhiteboard.c
libpurple/purplesqlitehistoryadapter.c
@@ -90,7 +89,6 @@
libpurple/request/purplerequestfieldstring.c
libpurple/request/purplerequestgroup.c
libpurple/request/purplerequestpage.c
libpurple/tests/test_account_manager.c