summaryrefslogtreecommitdiff
path: root/xmpp/pylon.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/pylon.lua')
-rw-r--r--xmpp/pylon.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmpp/pylon.lua b/xmpp/pylon.lua
index d00c41b..a3415dd 100644
--- a/xmpp/pylon.lua
+++ b/xmpp/pylon.lua
@@ -13,8 +13,7 @@ local Xmpp = class.extend(BasePylon)
function Xmpp.init(self)
self:_check_fields"server component component_secret"
-
- self.mucs = {}
+ self.channels = {}
end
-- only use on local connections!
@@ -44,13 +43,13 @@ end
function Xmpp.add_channel(self, channel)
local muc = { nick_to_user={}, user_to_nick={} }
- self.mucs[channel.id] = muc
+ self.channels[channel.id] = muc
local bot = {} ; self.bot = bot
bot.user, bot.nick, bot.user_jid, bot.nick_jid = self:ensure_and_get_user(channel.id, "wilson")
end
function Xmpp.ensure_and_get_user(self, muc_jid, nick, source_pylon)
- local muc = assert(self.mucs[muc_jid])
+ local muc = assert(self.channels[muc_jid])
local user = muc.nick_to_user[nick]
if user then
local user_jid = user..'@'..self.component
@@ -101,7 +100,7 @@ function Xmpp.recving(self)
if x.label == 'message' then
local from_bare_jid, from_nick
if x.xarg.from then from_bare_jid, from_nick = x.xarg.from:match"(.*)/(.*)" end
- local muc = self.mucs[from_bare_jid] ; if muc then
+ local muc = self.channels[from_bare_jid] ; if muc then
if
x.xarg.to == 'wilson@'..self.component
and body