# HG changeset patch # User tmolitor # Date 1502998372 -7200 # Node ID 2e30bb3a10d5410337c196e1418b6602e37fd015 # Parent 69248dcd7cff720d01c61973b2b7375fecd90c8d mod_csi_battery_saver: Fix a bug introduced by commit f43c77c69a8a Trying to clone strings, too, was a bad idea, this should fix it. diff -r 69248dcd7cff -r 2e30bb3a10d5 mod_csi_battery_saver/mod_csi_battery_saver.lua --- a/mod_csi_battery_saver/mod_csi_battery_saver.lua Thu Aug 17 21:21:23 2017 +0200 +++ b/mod_csi_battery_saver/mod_csi_battery_saver.lua Thu Aug 17 21:32:52 2017 +0200 @@ -159,8 +159,11 @@ function session.send(stanza) session.log("debug", "mod_csi_battery_saver(%s): Got stanza: <%s>", id, tostring(stanza.name or stanza)); local important = is_important(stanza, session); + -- clone stanzas before adding delay stamp and putting them into the queue + if st.is_stanza(stanza) then stanza = st.clone(stanza); end -- add delay stamp to unimportant (buffered) stanzas that can/need be stamped if not important and is_stamp_needed(stanza, session) then stanza = add_stamp(stanza, session); end + -- add stanza to outgoing queue and flush the buffer if needed pump:push(stanza); if important then session.log("debug", "mod_csi_battery_saver(%s): Encountered important stanza, flushing buffer: <%s>", id, tostring(stanza.name or stanza));