Mercurial > prosody-modules
comparison mod_saslauth_muc/mod_saslauth_muc.lua @ 3072:926db29176f5
mod_saslauth_muc: Use correct API for getting rooms
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 30 May 2018 09:10:59 +0200 |
parents | 249c5447fed1 |
children |
comparison
equal
deleted
inserted
replaced
3071:b6cac9d72255 | 3072:926db29176f5 |
---|---|
32 local function remove_handler_for(room, jid) if _rooms[room] then _rooms[room][jid] = nil; end end | 32 local function remove_handler_for(room, jid) if _rooms[room] then _rooms[room][jid] = nil; end end |
33 local function create_handler_for(room_jid, jid) | 33 local function create_handler_for(room_jid, jid) |
34 _rooms[room_jid] = _rooms[room_jid] or {}; | 34 _rooms[room_jid] = _rooms[room_jid] or {}; |
35 _rooms[room_jid][jid] = new_sasl(module.host, { plain = function(sasl, username, realm) | 35 _rooms[room_jid][jid] = new_sasl(module.host, { plain = function(sasl, username, realm) |
36 local muc = hosts[module.host].modules.muc; | 36 local muc = hosts[module.host].modules.muc; |
37 local room = muc and muc.get_room_by_jid(room_jid); | 37 local room = muc and muc.get_room_from_jid(room_jid); |
38 local password = room and muc_password.get(room); | 38 local password = room and muc_password.get(room); |
39 local ret = password and true or nil; | 39 local ret = password and true or nil; |
40 return password or "", ret; | 40 return password or "", ret; |
41 end }); | 41 end }); |
42 _rooms[room_jid][jid].timeout = os_time() + timeout; | 42 _rooms[room_jid][jid].timeout = os_time() + timeout; |