projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70eacd6
)
moduleapi: Add module:context(host) to produce a fake API context for a given host...
author
Matthew Wild
<mwild1@gmail.com>
Sat, 27 Apr 2013 13:57:24 +0000
(14:57 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Sat, 27 Apr 2013 13:57:24 +0000
(14:57 +0100)
core/moduleapi.lua
patch
|
blob
|
history
diff --git
a/core/moduleapi.lua
b/core/moduleapi.lua
index 30360f73547354afc245f2f2065ed35573f2ad02..da44db5ff9147ddc0fbe9bfaa053d9134b881d2a 100644
(file)
--- a/
core/moduleapi.lua
+++ b/
core/moduleapi.lua
@@
-270,6
+270,10
@@
function api:get_option_set(name, ...)
return set.new(value);
end
+function api:context(host)
+ return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
+end
+
function api:add_item(key, value)
self.items = self.items or {};
self.items[key] = self.items[key] or {};