|
@@ -19,6 +19,7 @@ local enableTokenVerification
|
19
|
19
|
= module:get_option_boolean("enable_roomsize_token_verification", false);
|
20
|
20
|
|
21
|
21
|
local token_util = module:require "token/util".new(module);
|
|
22
|
+local get_room_from_jid = module:require "util".get_room_from_jid;
|
22
|
23
|
|
23
|
24
|
-- no token configuration but required
|
24
|
25
|
if token_util == nil and enableTokenVerification then
|
|
@@ -31,26 +32,6 @@ end
|
31
|
32
|
local muc_domain_prefix
|
32
|
33
|
= module:get_option_string("muc_mapper_domain_prefix", "conference");
|
33
|
34
|
|
34
|
|
---- Finds and returns room by its jid
|
35
|
|
-function get_room_from_jid(room_jid)
|
36
|
|
- local _, host = jid.split(room_jid);
|
37
|
|
- local component = hosts[host];
|
38
|
|
- if component then
|
39
|
|
- local muc = component.modules.muc
|
40
|
|
- if muc and rawget(muc,"rooms") then
|
41
|
|
- -- We're running 0.9.x or 0.10 (old MUC API)
|
42
|
|
- return muc.rooms[room_jid];
|
43
|
|
- elseif muc and rawget(muc,"get_room_from_jid") then
|
44
|
|
- -- We're running >0.10 (new MUC API)
|
45
|
|
- return muc.get_room_from_jid(room_jid);
|
46
|
|
- else
|
47
|
|
- return
|
48
|
|
- end
|
49
|
|
- end
|
50
|
|
-end
|
51
|
|
-
|
52
|
35
|
--- Verifies room name, domain name with the values in the token
|
53
|
36
|
-- @param token the token we received
|
54
|
37
|
-- @param room_address the full room address jid
|