aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-03-15 02:53:05 +0000
committerMatthew Wild <mwild1@gmail.com>2012-03-15 02:53:05 +0000
commit78cd9a0ddcb2e3af03173eeceec270ef804603ec (patch)
treee2af271e6d548e6480172be94001d30686c6684a /core/moduleapi.lua
parent775261ef27a572da6e1c1ccacf79f59f6ead58ef (diff)
downloadprosody-78cd9a0ddcb2e3af03173eeceec270ef804603ec.tar.gz
prosody-78cd9a0ddcb2e3af03173eeceec270ef804603ec.zip
moduleapi: Add module:send() as an alias for core_post_stanza() from the current host's origin
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 2177378f..a577c07a 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -22,6 +22,7 @@ local tonumber, tostring = tonumber, tostring;
local prosody = prosody;
local hosts = prosody.hosts;
+local core_post_stanza = prosody.core_post_stanza;
-- Registry of shared module data
local shared_data = setmetatable({}, { __mode = "v" });
@@ -306,4 +307,8 @@ function api:provides(name, item)
self:add_item(name, item);
end
+function api:send(stanza)
+ return core_post_stanza(hosts[self.host], stanza);
+end
+
return api;