Mercurial > prosody-modules
comparison mod_offline_email/mod_offline_email.lua @ 3405:bd71c97de1d0
mod_offline_email: Allow LuaSocket to pollute the global scope, fixes traceback (*sigh*)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 16 Dec 2018 13:54:53 +0100 |
| parents | f1a0a0754b87 |
| children | ee724c7fa8e0 |
comparison
equal
deleted
inserted
replaced
| 3404:6444fb5dbb51 | 3405:bd71c97de1d0 |
|---|---|
| 1 | 1 |
| 2 local jid_bare = require "util.jid".bare; | 2 local jid_bare = require "util.jid".bare; |
| 3 local os_time = os.time; | 3 local os_time = os.time; |
| 4 local t_concat = table.concat; | 4 local t_concat = table.concat; |
| 5 | |
| 6 prosody.unlock_globals(); -- LuaSocket wants to pollute the global scope | |
| 5 local smtp = require "socket.smtp"; | 7 local smtp = require "socket.smtp"; |
| 8 prosody.lock_globals(); | |
| 6 | 9 |
| 7 local smtp_server = module:get_option_string("smtp_server", "localhost"); | 10 local smtp_server = module:get_option_string("smtp_server", "localhost"); |
| 8 local smtp_user = module:get_option_string("smtp_username"); | 11 local smtp_user = module:get_option_string("smtp_username"); |
| 9 local smtp_pass = module:get_option_string("smtp_password"); | 12 local smtp_pass = module:get_option_string("smtp_password"); |
| 10 | 13 |
