Mercurial > prosody-modules
comparison mod_muc_log_http/muc_log_http/mod_muc_log_http.lua @ 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 |
comparison
equal
deleted
inserted
replaced
390:8090d246c268 | 391:99e7ef4fc7d2 |
---|---|
296 local temptime = {day=0, month=0, year=0}; | 296 local temptime = {day=0, month=0, year=0}; |
297 topic = room._data.subject or "(no subject)" | 297 topic = room._data.subject or "(no subject)" |
298 if topic:len() > 135 then | 298 if topic:len() > 135 then |
299 topic = topic:sub(1, topic:find(" ", 120)) .. " ..." | 299 topic = topic:sub(1, topic:find(" ", 120)) .. " ..." |
300 end | 300 end |
301 for folder in lfs.dir(path) do | 301 local folders = {}; |
302 for folder in lfs.dir(path) do table.insert(folders, folder); end | |
303 table.sort(folders); | |
304 for _, folder in ipairs(folders) do | |
302 local year, month, day = folder:match("^(%d%d)(%d%d)(%d%d)"); | 305 local year, month, day = folder:match("^(%d%d)(%d%d)(%d%d)"); |
303 if year ~= nil and alreadyDoneYears[year] == nil then | 306 if year ~= nil and alreadyDoneYears[year] == nil then |
304 temptime.day = tonumber(day) | 307 temptime.day = tonumber(day) |
305 temptime.month = tonumber(month) | 308 temptime.month = tonumber(month) |
306 temptime.year = 2000 + tonumber(year) | 309 temptime.year = 2000 + tonumber(year) |