mod_admin_shell: Strip 'prosody:' prefix to allow narrower Role column
authorKim Alvefur <zash@zash.se>
Sun, 02 Apr 2023 22:44:29 +0200
changeset 13038 1387888a5596
parent 13037 a863e4237b91
child 13039 93c1590b5951
mod_admin_shell: Strip 'prosody:' prefix to allow narrower Role column
plugins/mod_admin_shell.lua
--- a/plugins/mod_admin_shell.lua	Thu Apr 06 16:30:26 2023 +0200
+++ b/plugins/mod_admin_shell.lua	Sun Apr 02 22:44:29 2023 +0200
@@ -966,11 +966,12 @@
 	};
 	role = {
 		title = "Role";
-		description = "Session role";
-		width = 20;
+		description = "Session role with 'prosody:' prefix removed";
+		width = #"admin";
 		key = "role";
 		mapper = function(role)
-			return role and role.name;
+			local name = role and role.name;
+			return name and name:match"^prosody:(%w+)" or name;
 		end;
 	}
 };