# HG changeset patch
# User daurnimator <quae@daurnimator.com>
# Date 1395958234 14400
# Node ID a6e526c00e6e7a0e3a804e0a9b6cf38683d8e240
# Parent  bf6de8ef66c2c6d3555552dc02b8667c39539d1e
plugins/muc/muc.lib: Have timestamp as seconds since epoch inside of history

diff -r bf6de8ef66c2 -r a6e526c00e6e plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Thu Mar 27 18:09:42 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Thu Mar 27 18:10:34 2014 -0400
@@ -131,10 +131,11 @@
 		if not history then history = {}; room._data['history'] = history; end
 		local stanza = st.clone(event.stanza);
 		stanza.attr.to = "";
-		local stamp = datetime.datetime();
+		local ts = gettime();
+		local stamp = datetime.datetime(ts);
 		stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = module.host, stamp = stamp}):up(); -- XEP-0203
 		stanza:tag("x", {xmlns = "jabber:x:delay", from = module.host, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated)
-		local entry = { stanza = stanza, stamp = stamp };
+		local entry = { stanza = stanza, timestamp = ts };
 		t_insert(history, entry);
 		while #history > room:get_historylength() do t_remove(history, 1) end
 	end
@@ -220,7 +221,7 @@
 			charcount = charcount + entry.chars + #to;
 			if charcount > maxchars then break; end
 		end
-		if since and since > entry.stamp then break; end
+		if since and since > entry.timestamp then break; end
 		if n + 1 > maxstanzas then break; end
 		n = n + 1;
 	end