Mercurial > prosody-modules
comparison mod_saslauth_muc/mod_saslauth_muc.lua @ 305:4c3abf1a9b5a
mod_auth_*, mod_saslauth_muc: Update SASL callbacks to take SASL handler as first argument.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 27 Dec 2010 20:15:21 +0500 |
parents | 6144fe6161f1 |
children | eb8b005d2a3d |
comparison
equal
deleted
inserted
replaced
304:8f3499ae1e27 | 305:4c3abf1a9b5a |
---|---|
28 local _rooms = {}; -- SASL data | 28 local _rooms = {}; -- SASL data |
29 local function get_handler_for(room, jid) return _rooms[room] and _rooms[room][jid]; end | 29 local function get_handler_for(room, jid) return _rooms[room] and _rooms[room][jid]; end |
30 local function remove_handler_for(room, jid) if _rooms[room] then _rooms[room][jid] = nil; end end | 30 local function remove_handler_for(room, jid) if _rooms[room] then _rooms[room][jid] = nil; end end |
31 local function create_handler_for(room_jid, jid) | 31 local function create_handler_for(room_jid, jid) |
32 _rooms[room_jid] = _rooms[room_jid] or {}; | 32 _rooms[room_jid] = _rooms[room_jid] or {}; |
33 _rooms[room_jid][jid] = new_sasl(module.host, { plain = function(username, realm) | 33 _rooms[room_jid][jid] = new_sasl(module.host, { plain = function(sasl, username, realm) |
34 local muc = hosts[module.host].modules.muc; | 34 local muc = hosts[module.host].modules.muc; |
35 local room = muc and muc.rooms[room_jid]; | 35 local room = muc and muc.rooms[room_jid]; |
36 local password = room and room:get_password(); | 36 local password = room and room:get_password(); |
37 local ret = password and true or false; | 37 local ret = password and true or false; |
38 return password, true; | 38 return password, true; |