plugins/muc/history.lib.lua
branch0.11
changeset 10234 dd7e924c74ef
parent 9084 ce57c69a20e2
child 10359 cb9755d7a36e
equal deleted inserted replaced
10215:224e681c4db2 10234:dd7e924c74ef
   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", { -- XEP-0203
   180 	stanza:tag("delay", { -- XEP-0203
   181 		xmlns = "urn:xmpp:delay", from = module.host, stamp = stamp
   181 		xmlns = "urn:xmpp:delay", from = room.jid, stamp = stamp
   182 	}):up();
   182 	}):up();
   183 	stanza:tag("x", { -- XEP-0091 (deprecated)
   183 	stanza:tag("x", { -- XEP-0091 (deprecated)
   184 		xmlns = "jabber:x:delay", from = module.host, stamp = datetime.legacy()
   184 		xmlns = "jabber:x:delay", from = room.jid, stamp = datetime.legacy()
   185 	}):up();
   185 	}):up();
   186 	local entry = { stanza = stanza, timestamp = ts };
   186 	local entry = { stanza = stanza, timestamp = ts };
   187 	table.insert(history, entry);
   187 	table.insert(history, entry);
   188 	while #history > get_historylength(room) do table.remove(history, 1) end
   188 	while #history > get_historylength(room) do table.remove(history, 1) end
   189 	return true;
   189 	return true;