Mercurial > prosody-modules
diff mod_srvinjection/mod_srvinjection.lua @ 1248:69f7840923f5
mod_srvinjection: Make the map a shared table so that other plugins can use/modify it
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Tue, 10 Dec 2013 23:15:15 +0000 |
parents | b3d130e4b3ae |
children | 853a382c9bd6 |
line wrap: on
line diff
--- a/mod_srvinjection/mod_srvinjection.lua Fri Dec 06 02:31:47 2013 +0000 +++ b/mod_srvinjection/mod_srvinjection.lua Tue Dec 10 23:15:15 2013 +0000 @@ -3,9 +3,10 @@ local adns = require "net.adns"; -local map = module:get_option("srvinjection") or {}; +local map_config = module:get_option("srvinjection") or {}; +local map = module:shared "s2s_map" -for host, mapping in pairs(map) do +for host, mapping in pairs(map_config) do if type(mapping) == "table" and type(mapping[1]) == "string" and (type(mapping[2]) == "number") then local connecthost, connectport = mapping[1], mapping[2] or 5269; map[host] = {{