comparison mod_mam/mod_mam.lua @ 2761:b13d07613b80

mod_mam: Clone stanza before stripping stanza id after carbons
author Kim Alvefur <zash@zash.se>
date Sun, 03 Sep 2017 12:43:24 +0200
parents 7c2416a1eb94
children f2096c03428b
comparison
equal deleted inserted replaced
2760:7c2416a1eb94 2761:b13d07613b80
328 return message_handler(event, true); 328 return message_handler(event, true);
329 end 329 end
330 330
331 local function strip_stanza_id(event) 331 local function strip_stanza_id(event)
332 local strip_by = jid_bare(event.origin.full_jid); 332 local strip_by = jid_bare(event.origin.full_jid);
333 event.stanza = st.clone(event.stanza);
333 event.stanza:maptags(function(tag) 334 event.stanza:maptags(function(tag)
334 if not ( tag.attr.xmlns == xmlns_st_id and tag.attr.by == strip_by ) then 335 if not ( tag.attr.xmlns == xmlns_st_id and tag.attr.by == strip_by ) then
335 return tag; 336 return tag;
336 end 337 end
337 end); 338 end);