Diff

mod_http_muc_log/mod_http_muc_log.lua @ 4677:823370bc2e4c

mod_http_muc_log: Sort rooms with a description before those without The listing looks nicer when rooms have proper titles and descriptions, therefore those that have this should be rewarded.
author Kim Alvefur <zash@zash.se>
date Sun, 12 Sep 2021 00:28:46 +0200
parent 4676:a2cf3b69a3d6
child 4781:306066898e5f
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Sun Sep 12 00:13:32 2021 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Sun Sep 12 00:28:46 2021 +0200
@@ -461,6 +461,11 @@
 
 	table.sort(room_list, function (a, b)
 		if a.priority ~= b.priority then return a.priority > b.priority; end
+		if a.description ~= nil and b.description == nil then
+			return true;
+		elseif a.description == nil and b.description ~= nil then
+			return false;
+		end
 		return a.jid < b.jid;
 	end);