# HG changeset patch # User Matthew Wild # Date 1331779985 0 # Node ID 20940729c1b484fbf396d5a04b5270b0e58e3cb6 # Parent 27fbc9c69eb5f980607212797d9a01b1828db3c2 moduleapi: Add module:send() as an alias for core_post_stanza() from the current host's origin diff -r 27fbc9c69eb5 -r 20940729c1b4 core/moduleapi.lua --- a/core/moduleapi.lua Thu Mar 15 02:52:31 2012 +0000 +++ b/core/moduleapi.lua Thu Mar 15 02:53:05 2012 +0000 @@ -22,6 +22,7 @@ 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 @@ self:add_item(name, item); end +function api:send(stanza) + return core_post_stanza(hosts[self.host], stanza); +end + return api;