Diff

mod_csi_battery_saver/mod_csi_battery_saver.lua @ 2737:f43c77c69a8a

mod_csi_battery_saver: Clone stanza pushed to queue
author Michel Le Bihan <michel@lebihan.pl>
date Tue, 15 Aug 2017 21:14:55 +0200
parent 2735:b5fae17e4403
child 2741:69248dcd7cff
line wrap: on
line diff
--- a/mod_csi_battery_saver/mod_csi_battery_saver.lua	Mon Aug 14 23:31:05 2017 +0200
+++ b/mod_csi_battery_saver/mod_csi_battery_saver.lua	Tue Aug 15 21:14:55 2017 +0200
@@ -9,6 +9,7 @@
 local jid = require "util.jid";
 local new_queue = require "util.queue".new;
 local datetime = require "util.datetime";
+local clone = require "util.stanza".clone;
 
 local xmlns_delay = "urn:xmpp:delay";
 
@@ -56,7 +57,7 @@
 	end
 	local push = q.push;
 	function q:push(item)
-		local ok = push(self, item);
+		local ok = push(self, clone(item));
 		if not ok then
 			q:flush();
 			output(item, self);