Comparison

mod_smacks/mod_smacks.lua @ 3621:c2c851722a8a

mod_smacks: fix prosody 0.9 compatibility
author tmolitor <thilo@eightysoft.de>
date Sun, 16 Jun 2019 02:00:12 +0200
parent 3620:fb1c8dee2ead
child 3634:915e32d5a147
comparison
equal deleted inserted replaced
3620:fb1c8dee2ead 3621:c2c851722a8a
106 local stopped = false; 106 local stopped = false;
107 local timer = module:add_timer(delay, function (t) 107 local timer = module:add_timer(delay, function (t)
108 if stopped then return; end 108 if stopped then return; end
109 return callback(t); 109 return callback(t);
110 end); 110 end);
111 if timer.stop then return timer; end -- new prosody api includes stop() function 111 if timer and timer.stop then return timer; end -- new prosody api includes stop() function
112 return { 112 return {
113 stop = function () stopped = true end; 113 stop = function () stopped = true end;
114 timer; 114 timer;
115 }; 115 };
116 end 116 end