Comparison

plugins/muc/history.lib.lua @ 9081:ce57c69a20e2

MUC: Split long lines [luacheck strict]
author Kim Alvefur <zash@zash.se>
date Fri, 03 Aug 2018 17:48:41 +0200
parent 9035:173c0e16e704
child 10230:dd7e924c74ef
comparison
equal deleted inserted replaced
9080:1b21f8ffaec8 9081:ce57c69a20e2
175 if not history then history = {}; room._history = history; end 175 if not history then history = {}; room._history = history; end
176 local stanza = st.clone(event.stanza); 176 local stanza = st.clone(event.stanza);
177 stanza.attr.to = ""; 177 stanza.attr.to = "";
178 local ts = gettime(); 178 local ts = gettime();
179 local stamp = datetime.datetime(ts); 179 local stamp = datetime.datetime(ts);
180 stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = module.host, stamp = stamp}):up(); -- XEP-0203 180 stanza:tag("delay", { -- XEP-0203
181 stanza:tag("x", {xmlns = "jabber:x:delay", from = module.host, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) 181 xmlns = "urn:xmpp:delay", from = module.host, stamp = stamp
182 }):up();
183 stanza:tag("x", { -- XEP-0091 (deprecated)
184 xmlns = "jabber:x:delay", from = module.host, stamp = datetime.legacy()
185 }):up();
182 local entry = { stanza = stanza, timestamp = ts }; 186 local entry = { stanza = stanza, timestamp = ts };
183 table.insert(history, entry); 187 table.insert(history, entry);
184 while #history > get_historylength(room) do table.remove(history, 1) end 188 while #history > get_historylength(room) do table.remove(history, 1) end
185 return true; 189 return true;
186 end, -1); 190 end, -1);