瀏覽代碼

Fixes using correct field for domain in multidomain mode.

j8
damencho 7 年之前
父節點
當前提交
f40faecfbe
共有 1 個檔案被更改,包括 10 行新增3 行删除
  1. 10
    3
      resources/prosody-plugins/mod_muc_poltergeist.lua

+ 10
- 3
resources/prosody-plugins/mod_muc_poltergeist.lua 查看文件

@@ -13,6 +13,12 @@ local poltergeist_component
13 13
 -- defaults to 3 min
14 14
 local poltergeist_timeout
15 15
     = module:get_option_string("poltergeist_leave_timeout", 180);
16
+-- this basically strips the domain from the conference.domain address
17
+local parentHostName = string.gmatch(tostring(module.host), "%w+.(%w.+)")();
18
+if parentHostName == nil then
19
+    log("error", "Failed to start - unable to get parent hostname");
20
+    return;
21
+end
16 22
 
17 23
 -- table to store all poltergeists we create
18 24
 local poltergeists = {};
@@ -28,8 +34,9 @@ local poltergeists_pr_ignore = {};
28 34
 -- @return returns room if found or nil
29 35
 function get_room(room_name, group)
30 36
     local room_address = jid.join(room_name, module:get_host());
31
-    -- if there is a group we are in multidomain mode
32
-    if group and group ~= "" then
37
+    -- if there is a group we are in multidomain mode and that group is not
38
+    -- our parent host
39
+    if group and group ~= "" and group ~= parentHostName then
33 40
         room_address = "["..group.."]"..room_address;
34 41
     end
35 42
 
@@ -92,7 +99,7 @@ prosody.events.add_handler("pre-jitsi-authentication", function(session)
92 99
     if (session.jitsi_meet_context_user) then
93 100
         local room = get_room(
94 101
             session.jitsi_bosh_query_room,
95
-            session.jitsi_meet_context_group);
102
+            session.jitsi_meet_domain);
96 103
 
97 104
         if (not room) then
98 105
             return nil;

Loading…
取消
儲存