changeset 391:99e7ef4fc7d2

mod_muc_log_http: Properly sort calendar listing.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 25 Jul 2011 02:21:40 +0500
parents 8090d246c268
children 369e665ae471
files mod_muc_log_http/muc_log_http/mod_muc_log_http.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua	Mon Jul 25 02:21:40 2011 +0500
+++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua	Mon Jul 25 02:21:40 2011 +0500
@@ -298,7 +298,10 @@
 		if topic:len() > 135 then
 			topic = topic:sub(1, topic:find(" ", 120)) .. " ..."
 		end
-		for folder in lfs.dir(path) do
+		local folders = {};
+		for folder in lfs.dir(path) do table.insert(folders, folder); end
+		table.sort(folders);
+		for _, folder in ipairs(folders) do
 			local year, month, day = folder:match("^(%d%d)(%d%d)(%d%d)");
 			if year ~= nil and alreadyDoneYears[year] == nil then
 				temptime.day = tonumber(day)