IRCv3: Update the join/part reasons to match the quit format

Fri, 18 Oct 2024 00:01:24 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 18 Oct 2024 00:01:24 -0500
changeset 43019
7621ef6ea06a
parent 43018
78cd7c6e8c40
child 43022
567e86fd4234

IRCv3: Update the join/part reasons to match the quit format

Testing Done:
Connected to my local ergo and had another client join and part with and with messages.

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

protocols/ircv3/purpleircv3messagehandlers.c file | annotate | diff | comparison | revisions
--- a/protocols/ircv3/purpleircv3messagehandlers.c	Thu Oct 17 23:58:52 2024 -0500
+++ b/protocols/ircv3/purpleircv3messagehandlers.c	Fri Oct 18 00:01:24 2024 -0500
@@ -43,7 +43,13 @@
 
 	member = purple_conversation_members_find_member(members, info);
 	if(!PURPLE_IS_CONVERSATION_MEMBER(member)) {
-		purple_conversation_members_add_member(members, info, TRUE, NULL);
+		char *message = NULL;
+
+		message = g_strdup_printf(_("%s has joined %s"),
+		                          purple_contact_info_get_sid(info),
+		                          purple_conversation_get_title_for_display(conversation));
+		purple_conversation_members_add_member(members, info, TRUE, message);
+		g_free(message);
 	}
 }
 
@@ -136,7 +142,17 @@
 	/* If a part message was given, join the remaining parameters with a space.
 	 */
 	if(n_params > 1) {
-		reason = g_strjoinv(" ", params + 1);
+		char *part_message = NULL;
+
+		part_message = g_strjoinv(" ", params + 1);
+		reason = g_strdup_printf(_("%s has left %s (%s)"),
+		                         purple_contact_info_get_sid(PURPLE_CONTACT_INFO(contact)),
+		                         purple_conversation_get_title_for_display(conversation),
+		                         part_message);
+	} else {
+		reason = g_strdup_printf(_("%s has left %s"),
+		                         purple_contact_info_get_sid(PURPLE_CONTACT_INFO(contact)),
+		                         purple_conversation_get_title_for_display(conversation));
 	}
 
 	purple_conversation_members_remove_member(members,

mercurial