Comparison

plugins/muc/muc.lib.lua @ 8474:7ad9d7c4161c

MUC: fix the @from on <delay/> in history replay (fixes #1054)
author Jonas Wielicki <jonas@wielicki.name>
date Sat, 09 Dec 2017 17:36:47 +0100
parent 8465:0ec72e67f797
child 8475:eb85b10e1fea
comparison
equal deleted inserted replaced
8465:0ec72e67f797 8474:7ad9d7c4161c
133 local history = self._data['history']; 133 local history = self._data['history'];
134 if not history then history = {}; self._data['history'] = history; end 134 if not history then history = {}; self._data['history'] = history; end
135 stanza = st.clone(stanza); 135 stanza = st.clone(stanza);
136 stanza.attr.to = ""; 136 stanza.attr.to = "";
137 local stamp = datetime.datetime(); 137 local stamp = datetime.datetime();
138 stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = muc_domain, stamp = stamp}):up(); -- XEP-0203 138 stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = self.jid, stamp = stamp}):up(); -- XEP-0203
139 stanza:tag("x", {xmlns = "jabber:x:delay", from = muc_domain, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) 139 stanza:tag("x", {xmlns = "jabber:x:delay", from = self.jid, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated)
140 local entry = { stanza = stanza, stamp = stamp }; 140 local entry = { stanza = stanza, stamp = stamp };
141 t_insert(history, entry); 141 t_insert(history, entry);
142 while #history > (self._data.history_length or default_history_length) do t_remove(history, 1) end 142 while #history > (self._data.history_length or default_history_length) do t_remove(history, 1) end
143 end 143 end
144 end 144 end