aboutsummaryrefslogtreecommitdiffstats
path: root/core
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
commita0549526b82982e1e7ec4a612e3d895868c1dd47 (patch)
treee2af271e6d548e6480172be94001d30686c6684a /core
parent4090846d760a746e67f19eda59becf291608eff2 (diff)
downloadprosody-a0549526b82982e1e7ec4a612e3d895868c1dd47.tar.gz
prosody-a0549526b82982e1e7ec4a612e3d895868c1dd47.zip
moduleapi: Add module:send() as an alias for core_post_stanza() from the current host's origin
Diffstat (limited to 'core')
-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;