--- a/protocols/ircv3/purpleircv3commands.c Wed Jul 16 01:08:36 2025 -0500 +++ b/protocols/ircv3/purpleircv3commands.c Thu Jul 17 20:28:54 2025 -0500 @@ -23,6 +23,7 @@ #include "purpleircv3commands.h" #include "purpleircv3connection.h" +#include "purpleircv3protocol.h" /****************************************************************************** * Internal Callbacks @@ -107,3 +108,42 @@ return FALSE; } + +gboolean +purple_ircv3_command_action_cb(G_GNUC_UNUSED PurpleCommand *command, + PurpleConversation *conversation, + GStrv params, + gpointer data) +{ + PurpleIRCv3Protocol *protocol = data; + PurpleAccount *account = NULL; + PurpleContactInfo *info = NULL; + PurpleConversationMember *author = NULL; + PurpleConversationMembers *members = NULL; + PurpleMessage *message = NULL; + PurpleProtocolConversation *protocol_conversation = NULL; + char *contents = NULL; + + account = purple_conversation_get_account(conversation); + info = purple_account_get_contact_info(account); + members = purple_conversation_get_members(conversation); + author = purple_conversation_members_find_member(members, info); + + contents = g_strjoinv(" ", params); + message = purple_message_new(author, contents); + g_free(contents); + + purple_message_set_action(message, TRUE); + + protocol_conversation = PURPLE_PROTOCOL_CONVERSATION(protocol); + purple_protocol_conversation_send_message_async(protocol_conversation, + conversation, + message, + NULL, + NULL, + NULL); + + g_clear_object(&message); + + return TRUE; +}