Software /
code /
prosody-modules
Comparison
mod_cloud_notify/mod_cloud_notify.lua @ 3622:21f870e1ba55
mod_cloud_notify: fix prosody 0.9 compatibility
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Sun, 16 Jun 2019 02:00:34 +0200 |
parent | 3619:74aa35aeb08a |
child | 3626:c84bbf36c878 |
comparison
equal
deleted
inserted
replaced
3621:c2c851722a8a | 3622:21f870e1ba55 |
---|---|
97 local stopped = false; | 97 local stopped = false; |
98 local timer = module:add_timer(delay, function (t) | 98 local timer = module:add_timer(delay, function (t) |
99 if stopped then return; end | 99 if stopped then return; end |
100 return callback(t); | 100 return callback(t); |
101 end); | 101 end); |
102 if timer.stop then return timer; end -- new prosody api includes stop() function | 102 if timer and timer.stop then return timer; end -- new prosody api includes stop() function |
103 return { | 103 return { |
104 stop = function () stopped = true end; | 104 stop = function () stopped = true end; |
105 timer; | 105 timer; |
106 }; | 106 }; |
107 end | 107 end |