Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 3516:de54a7ab7e6e
MUC: fix timezone support when sending history
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 12 Oct 2010 23:34:16 +0200 |
| parents | 711eb5bf94b4 |
| children | 530f7de1d265 |
comparison
equal
deleted
inserted
replaced
| 3515:bb494c3aa364 | 3516:de54a7ab7e6e |
|---|---|
| 176 | 176 |
| 177 local seconds = history_tag and tonumber(history_tag.attr.seconds); | 177 local seconds = history_tag and tonumber(history_tag.attr.seconds); |
| 178 if seconds then seconds = datetime.datetime(os.time() - math.floor(seconds)); end | 178 if seconds then seconds = datetime.datetime(os.time() - math.floor(seconds)); end |
| 179 | 179 |
| 180 local since = history_tag and history_tag.attr.since; | 180 local since = history_tag and history_tag.attr.since; |
| 181 if since and not since:match("^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d:%d%dZ$") then since = nil; end -- FIXME timezone support | 181 if since then since = datetime.parse(since); since = since and datetime.datetime(since); end |
| 182 if seconds and (not since or since < seconds) then since = seconds; end | 182 if seconds and (not since or since < seconds) then since = seconds; end |
| 183 | 183 |
| 184 local n = 0; | 184 local n = 0; |
| 185 local charcount = 0; | 185 local charcount = 0; |
| 186 local stanzacount = 0; | 186 local stanzacount = 0; |
