Remove Purple.Message.get_author_name and Purple.Message.get_author_alias

Tue, 27 Aug 2024 02:04:44 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 27 Aug 2024 02:04:44 -0500
changeset 42912
4e61e9b15844
parent 42911
15642e855d73
child 42913
3da85f0c0ee6

Remove Purple.Message.get_author_name and Purple.Message.get_author_alias

I also fixed a doc issue.

Testing Done:
Called in the turtles.

Bugs closed: PIDGIN-17723, PIDGIN-17906

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

libpurple/purplemessage.c file | annotate | diff | comparison | revisions
libpurple/purplemessage.h file | annotate | diff | comparison | revisions
--- a/libpurple/purplemessage.c	Tue Aug 27 01:04:50 2024 -0500
+++ b/libpurple/purplemessage.c	Tue Aug 27 02:04:44 2024 -0500
@@ -56,8 +56,6 @@
 	PROP_0,
 	PROP_ACTION,
 	PROP_AUTHOR,
-	PROP_AUTHOR_ALIAS,
-	PROP_AUTHOR_NAME,
 	PROP_AUTHOR_NAME_COLOR,
 	PROP_CONTENTS,
 	PROP_DELIVERED,
@@ -82,13 +80,7 @@
 static void
 purple_message_set_author(PurpleMessage *message, PurpleContactInfo *author) {
 	if(g_set_object(&message->author, author)) {
-		GObject *obj = G_OBJECT(message);
-
-		g_object_freeze_notify(obj);
-		g_object_notify_by_pspec(obj, properties[PROP_AUTHOR]);
-		g_object_notify_by_pspec(obj, properties[PROP_AUTHOR_ALIAS]);
-		g_object_notify_by_pspec(obj, properties[PROP_AUTHOR_NAME]);
-		g_object_thaw_notify(obj);
+		g_object_notify_by_pspec(G_OBJECT(message), properties[PROP_AUTHOR]);
 	}
 }
 
@@ -108,16 +100,6 @@
 	case PROP_AUTHOR:
 		g_value_set_object(value, purple_message_get_author(message));
 		break;
-	case PROP_AUTHOR_NAME:
-		G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-		g_value_set_string(value, purple_message_get_author_name(message));
-		G_GNUC_END_IGNORE_DEPRECATIONS
-		break;
-	case PROP_AUTHOR_ALIAS:
-		G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-		g_value_set_string(value, purple_message_get_author_alias(message));
-		G_GNUC_END_IGNORE_DEPRECATIONS
-		break;
 	case PROP_AUTHOR_NAME_COLOR:
 		g_value_set_string(value,
 		                   purple_message_get_author_name_color(message));
@@ -281,37 +263,6 @@
 		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
 
 	/**
-	 * PurpleMessage:author-alias:
-	 *
-	 * The alias of the author.
-	 *
-	 * Since: 3.0
-	 *
-	 * Deprecated: 3.0: Use [property@Message:author] instead.
-	 */
-	properties[PROP_AUTHOR_ALIAS] = g_param_spec_string(
-		"author-alias", NULL, NULL,
-		NULL,
-		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED);
-
-	/**
-	 * PurpleMessage:author-name:
-	 *
-	 * The name of author of the message.
-	 *
-	 * This is a temporary property that will be used to migrate to so that
-	 * [property@Message:author]'s type can be changed in the near future.
-	 *
-	 * Since: 3.0
-	 *
-	 * Deprecated: 3.0: Use [property@Message:author] instead.
-	 */
-	properties[PROP_AUTHOR_NAME] = g_param_spec_string(
-		"author-name", NULL, NULL,
-		NULL,
-		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED);
-
-	/**
 	 * PurpleMessage:author-name-color:
 	 *
 	 * The hex color for the author's name.
@@ -517,20 +468,6 @@
 	return message->author;
 }
 
-const char *
-purple_message_get_author_name(PurpleMessage *message) {
-	const char *name = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_MESSAGE(message), NULL);
-
-	name = purple_contact_info_get_username(message->author);
-	if(purple_strempty(name)) {
-		name = purple_contact_info_get_id(message->author);
-	}
-
-	return name;
-}
-
 void
 purple_message_set_author_name_color(PurpleMessage *message,
                                      const char *color)
@@ -550,13 +487,6 @@
 	return message->author_name_color;
 }
 
-const char *
-purple_message_get_author_alias(PurpleMessage *message) {
-	g_return_val_if_fail(PURPLE_IS_MESSAGE(message), NULL);
-
-	return purple_contact_info_get_alias(message->author);
-}
-
 void
 purple_message_set_contents(PurpleMessage *message, const char *contents) {
 	g_return_if_fail(PURPLE_IS_MESSAGE(message));
--- a/libpurple/purplemessage.h	Tue Aug 27 01:04:50 2024 -0500
+++ b/libpurple/purplemessage.h	Tue Aug 27 02:04:44 2024 -0500
@@ -94,29 +94,14 @@
  * purple_message_get_author:
  * @message: The message.
  *
- * Returns the author of the message, not a local alias.
+ * Gets the author of the message, not a local alias.
  *
- * Returns: the author of @message.
- *
- * Deprecated: 3.0: this is being repurposed in the future.
+ * Returns: (transfer none): The author of @message.
  */
 PURPLE_AVAILABLE_IN_3_0
 PurpleContactInfo *purple_message_get_author(PurpleMessage *message);
 
 /**
- * purple_message_get_author_name:
- * @message: The message.
- *
- * Returns the author of the message, not a local alias.
- *
- * Returns: the author of @message.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED_FOR(purple_message_get_author)
-const char *purple_message_get_author_name(PurpleMessage *message);
-
-/**
  * purple_message_get_author_name_color:
  * @message: The #PurpleMessage instance.
  *
@@ -145,22 +130,6 @@
 void purple_message_set_author_name_color(PurpleMessage *message, const char *color);
 
 /**
- * purple_message_get_author_alias:
- * @message: The message.
- *
- * Returns the alias of @message author.
- *
- * Returns: the @message author's alias.
- *
- * Since: 3.0
- *
- * Deprecated: 3.0: Use [property@ContactInfo:alias] on
- *             [property@Message:author] instead.
- */
-PURPLE_DEPRECATED
-const char *purple_message_get_author_alias(PurpleMessage *message);
-
-/**
  * purple_message_get_contents:
  * @message: The message.
  *

mercurial