# HG changeset patch
# Node ID 592860bff646
# Parent  53a9d24d5be2
diff --git a/libpurple/protocols/demo/purpledemoprotocolactions.c b/libpurple/protocols/demo/purpledemoprotocolactions.c
--- a/libpurple/protocols/demo/purpledemoprotocolactions.c
+++ b/libpurple/protocols/demo/purpledemoprotocolactions.c
@@ -153,6 +153,11 @@
 /******************************************************************************
  * PurpleProtocolActions Implementation
  *****************************************************************************/
+static const gchar *
+purple_demo_protocol_get_prefix(G_GNUC_UNUSED PurpleProtocolActions *actions) {
+	return "prpl-demo";
+}
+
 static GActionGroup *
 purple_demo_protocol_get_action_group(PurpleProtocolActions *actions,
                                       PurpleConnection *connection)
@@ -206,6 +211,7 @@
 
 void
 purple_demo_protocol_actions_init(PurpleProtocolActionsInterface *iface) {
+	iface->get_prefix = purple_demo_protocol_get_prefix;
 	iface->get_action_group = purple_demo_protocol_get_action_group;
 	iface->get_menu = purple_demo_protocol_get_menu;
 }
diff --git a/libpurple/purpleprotocolactions.h b/libpurple/purpleprotocolactions.h
--- a/libpurple/purpleprotocolactions.h
+++ b/libpurple/purpleprotocolactions.h
@@ -48,6 +48,8 @@
 
 /**
  * PurpleProtocolActionsInterface:
+ * @get_prefix: The prefix used for the actions in the group. If this isn't
+ *              implemented, the id of the protocol will be used instead.
  * @get_action_group: Returns the actions the protocol can perform. If actions
  *                    depend on connectivity, connect to the relevant signals
  *                    on the @connection and signal the action has changed with
@@ -67,6 +69,8 @@
 	GTypeInterface parent;
 
 	/*< public >*/
+	const gchar *(*get_prefix)(PurpleProtocolActions *actions);
+
 	GActionGroup *(*get_action_group)(PurpleProtocolActions *actions, PurpleConnection *connection);
 
 	GMenu *(*get_menu)(PurpleProtocolActions *actions);
@@ -78,6 +82,18 @@
 G_BEGIN_DECLS
 
 /**
+ * purple_protocol_actions_get_prefix:
+ * @actions: The PurpleProtocolActions instance.
+ *
+ * The prefix that should be used when inserting the action group into widgets.
+ *
+ * Returns: Gets the prefix for the name of the actions in @actions.
+ *
+ * Since: 3.0.0
+ */
+const gchar *purple_protocol_actions_get_prefix(PurpleProtocolActions *actions);
+
+/**
  * purple_protocol_actions_get_action_group:
  * @actions: The PurpleProtocolActions instance.
  * @connection: The [class@Connection] instance.
diff --git a/libpurple/purpleprotocolactions.c b/libpurple/purpleprotocolactions.c
--- a/libpurple/purpleprotocolactions.c
+++ b/libpurple/purpleprotocolactions.c
@@ -35,6 +35,24 @@
 /******************************************************************************
  * Public API
  *****************************************************************************/
+const gchar *
+purple_protocol_actions_get_prefix(PurpleProtocolActions *actions) {
+	PurpleProtocolActionsInterface *iface = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_PROTOCOL_ACTIONS(actions), NULL);
+
+	iface = PURPLE_PROTOCOL_ACTIONS_GET_IFACE(actions);
+	if(iface != NULL) {
+		if(iface->get_prefix != NULL) {
+			return iface->get_prefix(actions);
+		} else {
+			return purple_protocol_get_id(PURPLE_PROTOCOL(actions));
+		}
+	}
+
+	return NULL;
+}
+
 GActionGroup *
 purple_protocol_actions_get_action_group(PurpleProtocolActions *actions,
                                          PurpleConnection *connection)
diff --git a/pidgin/pidginaccountsenabledmenu.c b/pidgin/pidginaccountsenabledmenu.c
--- a/pidgin/pidginaccountsenabledmenu.c
+++ b/pidgin/pidginaccountsenabledmenu.c
@@ -93,7 +93,7 @@
 		                                                        connection);
 		if(G_IS_ACTION_GROUP(action_group)) {
 			GApplication *application = g_application_get_default();
-			const gchar *prefix = purple_protocol_get_id(protocol);
+			const gchar *prefix = purple_protocol_actions_get_prefix(actions);
 
 			pidgin_application_add_action_group(PIDGIN_APPLICATION(application),
 			                                    prefix, action_group);
@@ -122,6 +122,7 @@
 	protocol = purple_account_get_protocol(account);
 	if(PURPLE_IS_PROTOCOL_ACTIONS(protocol)) {
 		PurpleAccountManager *manager = NULL;
+		PurpleProtocolActions *actions = PURPLE_PROTOCOL_ACTIONS(protocol);
 		GList *enabled_accounts = NULL;
 		gboolean found = FALSE;
 
@@ -142,7 +143,7 @@
 
 		if(!found) {
 			GApplication *application = g_application_get_default();
-			const gchar *prefix = purple_protocol_get_id(protocol);
+			const gchar *prefix = purple_protocol_actions_get_prefix(actions);
 
 			pidgin_application_add_action_group(PIDGIN_APPLICATION(application),
 			                                    prefix, NULL);
