tools/ejabberd2prosody: Fixed private storage export
[prosody.git] / core / actions.lua
1 \r
2 local actions = {};\r
3 \r
4 function register(path, t)\r
5         local curr = actions;\r
6         for comp in path:gmatch("([^/]+)/") do\r
7                 if curr[comp] == nil then\r
8                         curr[comp] = {};\r
9                 end\r
10                 curr = curr[comp];\r
11                 if type(curr) ~= "table" then\r
12                         return nil, "path-taken";\r
13                 end\r
14         end\r
15         curr[path:match("/([^/]+)$")] = t;\r
16         return true;\r
17 end\r
18 \r
19 return { actions = actions, register= register };