Diff

core/moduleapi.lua @ 7342:79a5db780e8b

moduleapi: Allow an origin session to be passed to module:send()
author Kim Alvefur <zash@zash.se>
date Wed, 06 Apr 2016 21:29:30 +0200
parent 7163:eadbf19d0de0
child 7343:1da5a710848d
child 7646:6210dfaec84f
line wrap: on
line diff
--- a/core/moduleapi.lua	Wed Apr 06 14:44:51 2016 +0200
+++ b/core/moduleapi.lua	Wed Apr 06 21:29:30 2016 +0200
@@ -374,8 +374,8 @@
 	self:add_item(name.."-provider", item);
 end
 
-function api:send(stanza)
-	return core_post_stanza(hosts[self.host], stanza);
+function api:send(stanza, origin)
+	return core_post_stanza(origin or hosts[self.host], stanza);
 end
 
 function api:broadcast(jids, stanza, iter)