--- a/ChangeLog.API Fri Apr 12 02:08:00 2024 -0500
+++ b/ChangeLog.API Sat Apr 13 18:05:52 2024 -0500
@@ -415,23 +415,20 @@
* purple_conversation_get_message_history
* purple_conversation_get_remote_smileys
* purple_conversation_get_smiley
+ * purple_conversation_get_ui_ops * purple_conversation_is_logging
* purple_conversation_set_account
- * purple_conversations_add. Use purple_conversation_manager_register
- * purple_conversations_remove. Use
- purple_conversation_manager_unregister instead.
- * purple_conversations_get_all. Use purple_conversation_manager_get_all
- * purple_conversations_find_with_account. Use
- purple_conversation_manager_find instead.
- * purple_conversations_find_im_with_account. Use
- purple_conversation_manager_find_im instead.
- * purple_conversations_find_chat_with_account. Use
- purple_conversation_manager_find_chat instead.
- * purple_conversations_find_chat. Use
- purple_conversation_manager_find_chat_by_id instead.
* purple_conversation_set_logging
+ * purple_conversation_set_ui_ops + * purple_conversations_add. + * purple_conversations_get_all. + * purple_conversations_find_with_account. + * purple_conversations_find_im_with_account. + * purple_conversations_find_chat_with_account. + * purple_conversations_find_chat. + * purple_conversations_get_ui_ops. + * purple_conversations_remove. + * purple_conversations_set_ui_ops. * purple_core_get_ui, use purple_core_get_ui_info instead.
* purple_core_ensure_single_instance. Check via GApplication
or whatever is appropriate for your UI.
--- a/libpurple/buddy.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/buddy.c Sat Apr 13 18:05:52 2024 -0500
@@ -25,6 +25,7 @@
#include "purplecontactmanager.h"
#include "purpleconversationmanager.h"
+#include "purpleimconversation.h" #include "purpleprotocolclient.h"
--- a/libpurple/buddyicon.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/buddyicon.c Sat Apr 13 18:05:52 2024 -0500
@@ -24,6 +24,7 @@
#include "purpleaccountmanager.h"
+#include "purplechatconversation.h" #include "purpleconversation.h"
#include "purpleconversationmanager.h"
--- a/libpurple/cmds.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/cmds.c Sat Apr 13 18:05:52 2024 -0500
@@ -22,6 +22,8 @@
#include "purpleaccount.h"
+#include "purplechatconversation.h" +#include "purpleimconversation.h" #include "purplemarkup.h"
static GList *cmds = NULL;
--- a/libpurple/connection.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/connection.c Sat Apr 13 18:05:52 2024 -0500
@@ -57,9 +57,6 @@
PurpleAccount *account; /* The account being connected to. */
char *password; /* The password used. */
- GSList *active_chats; /* A list of active chats
- (#PurpleChatConversation structs). */
char *display_name; /* How you appear to other people. */
/* Wants to Die state. This is set when the user chooses to log out, or
@@ -281,17 +278,6 @@
g_object_notify_by_pspec(G_OBJECT(connection), properties[PROP_PASSWORD]);
-purple_connection_get_active_chats(PurpleConnection *connection) {
- PurpleConnectionPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_CONNECTION(connection), NULL);
- priv = purple_connection_get_instance_private(connection);
- return priv->active_chats;
purple_connection_get_display_name(PurpleConnection *connection) {
PurpleConnectionPrivate *priv = NULL;
@@ -303,19 +289,6 @@
return priv->display_name;
-_purple_connection_remove_active_chat(PurpleConnection *connection,
- PurpleChatConversation *chat)
- PurpleConnectionPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_CONNECTION(connection));
- priv = purple_connection_get_instance_private(connection);
- priv->active_chats = g_slist_remove(priv->active_chats, chat);
_purple_connection_wants_to_die(PurpleConnection *connection) {
PurpleConnectionPrivate *priv = NULL;
@@ -879,9 +852,6 @@
PURPLE_CONNECTION_STATE_DISCONNECTING);
purple_signal_emit(handle, "signing-off", connection);
- g_slist_free_full(priv->active_chats,
- (GDestroyNotify)purple_chat_conversation_leave);
/* Dispatch to the connection's disconnect method. */
klass = PURPLE_CONNECTION_GET_CLASS(connection);
if(klass != NULL && klass->disconnect != NULL) {
--- a/libpurple/conversations.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/conversations.c Sat Apr 13 18:05:52 2024 -0500
@@ -24,22 +24,10 @@
#include "purpleprivate.h"
+#include "purplechatconversation.h" +#include "purpleimconversation.h" #include "purpleconversationmanager.h"
-static PurpleConversationUiOps *default_ops = NULL;
-purple_conversations_set_ui_ops(PurpleConversationUiOps *ops)
-PurpleConversationUiOps *
-purple_conversations_get_ui_ops(void)
purple_conversations_get_handle(void)
--- a/libpurple/conversations.h Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/conversations.h Sat Apr 13 18:05:52 2024 -0500
@@ -37,29 +37,6 @@
/**************************************************************************/
- * purple_conversations_set_ui_ops:
- * @ops: The UI conversation operations structure.
- * Sets the default conversation UI operations structure.
-void purple_conversations_set_ui_ops(PurpleConversationUiOps *ops);
- * purple_conversations_get_ui_ops:
- * Gets the default conversation UI operations structure.
- * Returns: The UI conversation operations structure.
-PurpleConversationUiOps *purple_conversations_get_ui_ops(void);
* purple_conversations_get_handle:
* Returns the conversation subsystem handle.
--- a/libpurple/meson.build Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/meson.build Sat Apr 13 18:05:52 2024 -0500
@@ -46,7 +46,6 @@
'purpleconversationmanager.c',
'purpleconversationmember.c',
- 'purpleconversationuiops.c',
'purplecreateconversationdetails.c',
'purplecredentialmanager.c',
'purplecredentialprovider.c',
@@ -162,7 +161,6 @@
'purpleconversationmanager.h',
'purpleconversationmember.h',
- 'purpleconversationuiops.h',
'purplecreateconversationdetails.h',
'purplecredentialmanager.h',
'purplecredentialprovider.h',
--- a/libpurple/purplechatconversation.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purplechatconversation.c Sat Apr 13 18:05:52 2024 -0500
@@ -226,14 +226,6 @@
if(!purple_chat_conversation_has_left(chat)) {
purple_serv_chat_leave(gc, chat_id);
- * If they didn't call purple_serv_got_chat_left by now, it's too late.
- * So we better do it for them before we destroy the thing.
- if(!purple_chat_conversation_has_left(chat)) {
- purple_serv_got_chat_left(gc, chat_id);
g_clear_pointer(&priv->users, g_hash_table_destroy);
@@ -478,7 +470,6 @@
PurpleConversation *conv;
- PurpleConversationUiOps *ops;
PurpleChatUser *chatuser;
PurpleChatConversationPrivate *priv;
@@ -492,7 +483,6 @@
priv = purple_chat_conversation_get_instance_private(chat);
conv = PURPLE_CONVERSATION(chat);
- ops = purple_conversation_get_ui_ops(conv);
account = purple_conversation_get_account(conv);
gc = purple_conversation_get_connection(conv);
@@ -578,10 +568,6 @@
cbuddies = g_list_sort(cbuddies, (GCompareFunc)purple_chat_user_compare);
- if(ops != NULL && ops->chat_add_users != NULL) {
- ops->chat_add_users(chat, cbuddies, new_arrivals);
@@ -591,7 +577,6 @@
PurpleConversation *conv;
- PurpleConversationUiOps *ops;
PurpleProtocol *protocol;
@@ -609,7 +594,6 @@
priv = purple_chat_conversation_get_instance_private(chat);
conv = PURPLE_CONVERSATION(chat);
- ops = purple_conversation_get_ui_ops(conv);
account = purple_conversation_get_account(conv);
gc = purple_conversation_get_connection(conv);
@@ -648,10 +632,6 @@
g_hash_table_replace(priv->users,
g_strdup(purple_chat_user_get_name(cb)), cb);
- if(ops != NULL && ops->chat_rename_user != NULL) {
- ops->chat_rename_user(chat, old_user, new_user, new_alias);
cb = purple_chat_conversation_find_user(chat, old_user);
g_hash_table_remove(priv->users, purple_chat_user_get_name(cb));
@@ -716,7 +696,6 @@
PurpleConversation *conv;
PurpleProtocol *protocol;
- PurpleConversationUiOps *ops;
PurpleChatConversationPrivate *priv;
@@ -735,7 +714,6 @@
protocol = purple_connection_get_protocol(gc);
g_return_if_fail(PURPLE_IS_PROTOCOL(protocol));
- ops = purple_conversation_get_ui_ops(conv);
handle = purple_conversations_get_handle();
for(l = users; l != NULL; l = l->next) {
@@ -784,28 +762,18 @@
g_signal_emit(chat, signals[SIG_USER_LEFT], 0, user, reason);
- if(ops != NULL && ops->chat_remove_users != NULL) {
- ops->chat_remove_users(chat, users);
purple_chat_conversation_clear_users(PurpleChatConversation *chat) {
PurpleChatConversationPrivate *priv = NULL;
- PurpleConversationUiOps *ops = NULL;
g_return_if_fail(PURPLE_IS_CHAT_CONVERSATION(chat));
priv = purple_chat_conversation_get_instance_private(chat);
- ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat));
names = g_hash_table_get_keys(priv->users);
- if(ops != NULL && ops->chat_remove_users != NULL) {
- ops->chat_remove_users(chat, names);
g_list_foreach(names, purple_chat_conversation_clear_users_helper, chat);
--- a/libpurple/purplechatuser.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purplechatuser.c Sat Apr 13 18:05:52 2024 -0500
@@ -268,7 +268,6 @@
purple_chat_user_set_flags(PurpleChatUser *chat_user,
PurpleChatUserFlags flags)
- PurpleConversationUiOps *ops;
PurpleChatUserFlags oldflags;
g_return_if_fail(PURPLE_IS_CHAT_USER(chat_user));
@@ -282,17 +281,6 @@
g_object_notify_by_pspec(G_OBJECT(chat_user), properties[PROP_FLAGS]);
- /* Only update the UI once the object is fully constructed. This avoids an
- * issue where at least with XMPP, user names will be duplicated in the
- if(chat_user->constructed) {
- ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat_user->chat));
- if(ops != NULL && ops->chat_update_user != NULL) {
- ops->chat_update_user(chat_user);
purple_signal_emit(purple_conversations_get_handle(),
"chat-user-flags", chat_user, oldflags, flags);
--- a/libpurple/purpleconversation.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purpleconversation.c Sat Apr 13 18:05:52 2024 -0500
@@ -27,6 +27,7 @@
#include "conversations.h"
+#include "purplechatconversation.h" #include "purpleconversationmanager.h"
#include "purpleconversationmember.h"
@@ -46,8 +47,6 @@
- PurpleConversationUiOps *ui_ops;
PurpleConnectionFlags features;
@@ -573,7 +572,6 @@
PurpleConversation *conv = PURPLE_CONVERSATION(object);
- PurpleConversationUiOps *ops;
G_OBJECT_CLASS(purple_conversation_parent_class)->constructed(object);
@@ -591,16 +589,6 @@
/* Auto-set the title. */
purple_conversation_autoset_title(conv);
- /* Don't move this.. it needs to be one of the last things done otherwise
- * it causes mysterious crashes on my system.
- ops = purple_conversations_get_ui_ops();
- purple_conversation_set_ui_ops(conv, ops);
- if(ops != NULL && ops->create_conversation != NULL) {
- ops->create_conversation(conv);
purple_signal_emit(purple_conversations_get_handle(),
"conversation-created", conv);
@@ -617,17 +605,12 @@
PurpleConversation *conv = PURPLE_CONVERSATION(object);
PurpleConversationPrivate *priv =
purple_conversation_get_instance_private(conv);
- PurpleConversationUiOps *ops = purple_conversation_get_ui_ops(conv);
purple_request_close_with_handle(conv);
purple_signal_emit(purple_conversations_get_handle(),
"deleting-conversation", conv);
- if(ops != NULL && ops->destroy_conversation != NULL) {
- ops->destroy_conversation(conv);
g_clear_pointer(&priv->id, g_free);
g_clear_object(&priv->avatar);
g_clear_pointer(&priv->name, g_free);
@@ -1080,15 +1063,7 @@
-purple_conversation_present(PurpleConversation *conv) {
- PurpleConversationUiOps *ops;
- g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
- ops = purple_conversation_get_ui_ops(conv);
- if(ops && ops->present) {
+purple_conversation_present(G_GNUC_UNUSED PurpleConversation *conv) { @@ -1118,38 +1093,6 @@
-purple_conversation_set_ui_ops(PurpleConversation *conv,
- PurpleConversationUiOps *ops)
- PurpleConversationPrivate *priv = NULL;
- g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
- priv = purple_conversation_get_instance_private(conv);
- if(priv->ui_ops == ops) {
- if(priv->ui_ops != NULL && priv->ui_ops->destroy_conversation != NULL) {
- priv->ui_ops->destroy_conversation(conv);
-PurpleConversationUiOps *
-purple_conversation_get_ui_ops(PurpleConversation *conv) {
- PurpleConversationPrivate *priv = NULL;
- g_return_val_if_fail(PURPLE_IS_CONVERSATION(conv), NULL);
- priv = purple_conversation_get_instance_private(conv);
purple_conversation_get_id(PurpleConversation *conversation) {
PurpleConversationPrivate *priv = NULL;
@@ -1310,7 +1253,6 @@
PurpleConnection *gc = NULL;
PurpleConversationPrivate *priv = NULL;
- PurpleConversationUiOps *ops;
/* int logging_font_options = 0; */
@@ -1320,19 +1262,13 @@
priv = purple_conversation_get_instance_private(conv);
- ops = purple_conversation_get_ui_ops(conv);
account = purple_conversation_get_account(conv);
gc = purple_account_get_connection(account);
- if(PURPLE_IS_CHAT_CONVERSATION(conv) && gc != NULL) {
- if(!g_slist_find(purple_connection_get_active_chats(gc), conv)) {
- } else if(PURPLE_IS_IM_CONVERSATION(conv)) {
+ if(PURPLE_IS_IM_CONVERSATION(conv)) { PurpleConversationManager *manager = NULL;
manager = purple_conversation_manager_get_default();
@@ -1398,16 +1334,6 @@
g_list_store_append(priv->messages, pmsg);
- if (PURPLE_IS_CHAT_CONVERSATION(conv) && ops->write_chat) {
- ops->write_chat(PURPLE_CHAT_CONVERSATION(conv), pmsg);
- } else if (PURPLE_IS_IM_CONVERSATION(conv) && ops->write_im) {
- ops->write_im(PURPLE_IM_CONVERSATION(conv), pmsg);
- } else if (ops->write_conv) {
- ops->write_conv(conv, pmsg);
purple_signal_emit(purple_conversations_get_handle(),
(PURPLE_IS_IM_CONVERSATION(conv) ? "wrote-im-msg" : "wrote-chat-msg"),
@@ -1459,16 +1385,9 @@
purple_conversation_has_focus(PurpleConversation *conv) {
- PurpleConversationUiOps *ops;
g_return_val_if_fail(PURPLE_IS_CONVERSATION(conv), FALSE);
- ops = purple_conversation_get_ui_ops(conv);
- if(ops != NULL && ops->has_focus != NULL) {
- ret = ops->has_focus(conv);
@@ -1514,19 +1433,12 @@
purple_conversation_send_confirm(PurpleConversation *conv,
- PurpleConversationPrivate *priv = NULL;
g_return_if_fail(PURPLE_IS_CONVERSATION(conv));
g_return_if_fail(message != NULL);
- priv = purple_conversation_get_instance_private(conv);
- if(priv->ui_ops != NULL && priv->ui_ops->send_confirm != NULL) {
- priv->ui_ops->send_confirm(conv, message);
text = g_strdup_printf("You are about to send the following message:\n%s",
data = g_new0(gpointer, 2);
--- a/libpurple/purpleconversation.h Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purpleconversation.h Sat Apr 13 18:05:52 2024 -0500
@@ -157,7 +157,6 @@
#include "purpleaccount.h"
-#include "purpleconversationuiops.h"
@@ -238,31 +237,6 @@
void purple_conversation_present(PurpleConversation *conv);
- * purple_conversation_set_ui_ops:
- * @conv: The conversation.
- * @ops: The UI conversation operations structure.
- * Sets the specified conversation's UI operations structure.
-void purple_conversation_set_ui_ops(PurpleConversation *conv, PurpleConversationUiOps *ops);
- * purple_conversation_get_ui_ops:
- * @conv: The conversation.
- * Returns the specified conversation's UI operations structure.
- * Returns: The operations structure.
-PurpleConversationUiOps *purple_conversation_get_ui_ops(PurpleConversation *conv);
* purple_conversation_get_id:
* @conversation: The instance.
--- a/libpurple/purpleprivate.h Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purpleprivate.h Sat Apr 13 18:05:52 2024 -0500
@@ -83,19 +83,6 @@
gboolean _purple_connection_wants_to_die(PurpleConnection *gc);
- * _purple_connection_remove_active_chat:
- * @chat: The chat conversation to remove
- * Removes a chat from the active chats list of a connection
- * Note: This function should only be called by purple_serv_got_chat_left()
-void _purple_connection_remove_active_chat(PurpleConnection *gc, PurpleChatConversation *chat);
* _purple_statuses_get_primitive_scores:
* Note: This function should only be called by
--- a/libpurple/purpleprotocolim.h Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/purpleprotocolim.h Sat Apr 13 18:05:52 2024 -0500
@@ -30,8 +30,6 @@
-#include "purpleconversation.h"
#include "purpleprotocol.h"
#include "purpleversion.h"
@@ -49,6 +47,10 @@
G_DECLARE_INTERFACE(PurpleProtocolIM, purple_protocol_im, PURPLE, PROTOCOL_IM,
+#include "purpleconversation.h" +#include "purpleimconversation.h" struct _PurpleProtocolIMInterface {
--- a/libpurple/server.h Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/server.h Sat Apr 13 18:05:52 2024 -0500
@@ -171,18 +171,6 @@
void purple_serv_join_chat(PurpleConnection *gc, GHashTable *data);
- * purple_serv_got_chat_left:
- * @g: The connection on which the chat was left.
- * @id: The id of the chat, as assigned by the protocol.
- * Called by a protocol when an account has left a chat.
-void purple_serv_got_chat_left(PurpleConnection *g, int id);
#endif /* PURPLE_SERVER_H */
--- a/libpurple/tests/test_ui.c Fri Apr 12 02:08:00 2024 -0500
+++ b/libpurple/tests/test_ui.c Sat Apr 13 18:05:52 2024 -0500
@@ -40,25 +40,6 @@
-/*** Conversation uiops ***/
-test_write_conv(PurpleConversation *conv, PurpleMessage *msg)
- gchar *timestamp = purple_message_format_timestamp(msg, "(%H:%M:%S)");
- printf("(%s) %s %s: %s\n",
- purple_conversation_get_name(conv),
- purple_message_get_author_alias(msg),
- purple_message_get_contents(msg));
-static PurpleConversationUiOps test_conv_uiops = {
- .write_conv = test_write_conv
/******************************************************************************
* PurpleUi Implementation
*****************************************************************************/
@@ -72,8 +53,6 @@
test_purple_ui_start(G_GNUC_UNUSED PurpleUi *ui, G_GNUC_UNUSED GError **error) {
- purple_conversations_set_ui_ops(&test_conv_uiops);
--- a/po/POTFILES.in Fri Apr 12 02:08:00 2024 -0500
+++ b/po/POTFILES.in Sat Apr 13 18:05:52 2024 -0500
@@ -48,7 +48,6 @@
libpurple/purplecontact.c
libpurple/purpleconversation.c
libpurple/purpleconversationmanager.c
-libpurple/purpleconversationuiops.c
libpurple/purplecredentialmanager.c
libpurple/purplecredentialprovider.c
libpurple/purpledebugui.c