Remove Purple.Conversation:name

Mon, 13 Jan 2025 01:22:01 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 13 Jan 2025 01:22:01 -0600
changeset 43135
d00a312b1d42
parent 43134
dd4dc828a49d
child 43136
36eba703e2b9

Remove Purple.Conversation:name

This property doesn't make sense anymore as it has been replaced by ids and
titles.

Testing Done:
Called in the turtles with the patches from /r/3746 and /r/3747

Bugs closed: PIDGIN-18001

Reviewed at https://reviews.imfreedom.org/r/3748/

libpurple/purpleconversation.c file | annotate | diff | comparison | revisions
libpurple/purpleconversation.h file | annotate | diff | comparison | revisions
libpurple/tests/test_conversation.c file | annotate | diff | comparison | revisions
libpurple/tests/test_history_adapter.c file | annotate | diff | comparison | revisions
libpurple/tests/test_history_manager.c file | annotate | diff | comparison | revisions
--- a/libpurple/purpleconversation.c	Mon Jan 13 00:57:42 2025 -0600
+++ b/libpurple/purpleconversation.c	Mon Jan 13 01:22:01 2025 -0600
@@ -43,7 +43,6 @@
 	PurpleAccount *account;
 
 	PurpleAvatar *avatar;
-	char *name;
 	char *alias;
 	char *title;
 	gboolean title_generated;
@@ -83,7 +82,6 @@
 	PROP_TYPE,
 	PROP_ACCOUNT,
 	PROP_AVATAR,
-	PROP_NAME,
 	PROP_ALIAS,
 	PROP_TITLE,
 	PROP_TITLE_FOR_DISPLAY,
@@ -512,9 +510,6 @@
 		purple_conversation_set_avatar(conversation,
 		                               g_value_get_object(value));
 		break;
-	case PROP_NAME:
-		purple_conversation_set_name(conversation, g_value_get_string(value));
-		break;
 	case PROP_ALIAS:
 		purple_conversation_set_alias(conversation, g_value_get_string(value));
 		break;
@@ -615,9 +610,6 @@
 		g_value_set_object(value,
 		                   purple_conversation_get_avatar(conversation));
 		break;
-	case PROP_NAME:
-		g_value_set_string(value, purple_conversation_get_name(conversation));
-		break;
 	case PROP_ALIAS:
 		g_value_set_string(value, purple_conversation_get_alias(conversation));
 		break;
@@ -762,7 +754,6 @@
 	g_clear_object(&conversation->account);
 	g_clear_pointer(&conversation->id, g_free);
 	g_clear_object(&conversation->avatar);
-	g_clear_pointer(&conversation->name, g_free);
 	g_clear_pointer(&conversation->alias, g_free);
 	g_clear_pointer(&conversation->title, g_free);
 
@@ -865,18 +856,6 @@
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
 	/**
-	 * PurpleConversation:name:
-	 *
-	 * The name of the conversation.
-	 *
-	 * Since: 3.0
-	 */
-	properties[PROP_NAME] = g_param_spec_string(
-		"name", NULL, NULL,
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
 	 * PurpleConversation:alias:
 	 *
 	 * An alias for the conversation that is local to the libpurple user.
@@ -1454,25 +1433,6 @@
 }
 
 void
-purple_conversation_set_name(PurpleConversation *conversation,
-                             const char *name)
-{
-	g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
-
-	if(g_set_str(&conversation->name, name)) {
-		g_object_notify_by_pspec(G_OBJECT(conversation),
-		                         properties[PROP_NAME]);
-	}
-}
-
-const char *
-purple_conversation_get_name(PurpleConversation *conversation) {
-	g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
-
-	return conversation->name;
-}
-
-void
 purple_conversation_write_message(PurpleConversation *conversation,
                                   PurpleMessage *message)
 {
--- a/libpurple/purpleconversation.h	Mon Jan 13 00:57:42 2025 -0600
+++ b/libpurple/purpleconversation.h	Mon Jan 13 01:22:01 2025 -0600
@@ -312,32 +312,6 @@
 gboolean purple_conversation_get_title_generated(PurpleConversation *conversation);
 
 /**
- * purple_conversation_set_name:
- * @conversation: The conversation.
- * @name: The conversation's name.
- *
- * Sets the specified conversation's name.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-void purple_conversation_set_name(PurpleConversation *conversation, const char *name);
-
-/**
- * purple_conversation_get_name:
- * @conversation: The conversation.
- *
- * Returns the specified conversation's name.
- *
- * Returns: The conversation's name. If the conversation is an IM with a
- *          PurpleBuddy, then it's the name of the PurpleBuddy.
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-const char *purple_conversation_get_name(PurpleConversation *conversation);
-
-/**
  * purple_conversation_write_message:
  * @conversation: The conversation.
  * @message: The message to write.
--- a/libpurple/tests/test_conversation.c	Mon Jan 13 00:57:42 2025 -0600
+++ b/libpurple/tests/test_conversation.c	Mon Jan 13 01:22:01 2025 -0600
@@ -65,7 +65,6 @@
 	GError *error1 = NULL;
 	char *global_id = NULL;
 	char *id = NULL;
-	char *name = NULL;
 	char *title = NULL;
 	char *title_for_display = NULL;
 	char *topic = NULL;
@@ -108,7 +107,6 @@
 		"favorite", TRUE,
 		"id", "id1",
 		"logging", TRUE,
-		"name", "name1",
 		"needs-attention", TRUE,
 		"title", "test conversation",
 		"topic", "the topic...",
@@ -135,7 +133,6 @@
 		"id", &id,
 		"logging", &logging,
 		"members", &members,
-		"name", &name,
 		"needs-attention", &needs_attention,
 		"tags", &tags,
 		"title", &title,
@@ -190,9 +187,6 @@
 
 	g_assert_true(logging);
 
-	g_assert_cmpstr(name, ==, "name1");
-	g_clear_pointer(&name, g_free);
-
 	g_assert_true(needs_attention);
 
 	g_assert_true(PURPLE_IS_TAGS(tags));
@@ -485,7 +479,6 @@
 		PURPLE_TYPE_CONVERSATION,
 		"account", account,
 		"type", PURPLE_CONVERSATION_TYPE_DM,
-		"name", "bleh",
 		NULL);
 
 	g_signal_connect(conversation, "present",
--- a/libpurple/tests/test_history_adapter.c	Mon Jan 13 00:57:42 2025 -0600
+++ b/libpurple/tests/test_history_adapter.c	Mon Jan 13 01:22:01 2025 -0600
@@ -246,7 +246,6 @@
 	account = purple_account_new("test", "test");
 	conversation = g_object_new(PURPLE_TYPE_CONVERSATION,
 	                            "account", account,
-	                            "name", "pidgy",
 	                            "type", PURPLE_CONVERSATION_TYPE_DM,
 	                            NULL);
 	result = purple_history_adapter_write(adapter, conversation, message,
--- a/libpurple/tests/test_history_manager.c	Mon Jan 13 00:57:42 2025 -0600
+++ b/libpurple/tests/test_history_manager.c	Mon Jan 13 01:22:01 2025 -0600
@@ -414,7 +414,6 @@
 	account = purple_account_new("test", "test");
 	conversation = g_object_new(PURPLE_TYPE_CONVERSATION,
 	                            "account", account,
-	                            "name", "pidgy",
 	                            "type", PURPLE_CONVERSATION_TYPE_DM,
 	                            NULL);
 
@@ -539,7 +538,6 @@
 	account = purple_account_new("test", "test");
 	conversation = g_object_new(PURPLE_TYPE_CONVERSATION,
 	                            "account", account,
-	                            "name", "pidgy",
 	                            "type", PURPLE_CONVERSATION_TYPE_DM,
 	                            NULL);
 	result = purple_history_manager_write(manager, conversation, message,

mercurial