Kaynağa Gözat

Fixes using correct field for domain in multidomain mode.

j8
damencho 7 yıl önce
ebeveyn
işleme
f40faecfbe

+ 10
- 3
resources/prosody-plugins/mod_muc_poltergeist.lua Dosyayı Görüntüle

13
 -- defaults to 3 min
13
 -- defaults to 3 min
14
 local poltergeist_timeout
14
 local poltergeist_timeout
15
     = module:get_option_string("poltergeist_leave_timeout", 180);
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
 -- table to store all poltergeists we create
23
 -- table to store all poltergeists we create
18
 local poltergeists = {};
24
 local poltergeists = {};
28
 -- @return returns room if found or nil
34
 -- @return returns room if found or nil
29
 function get_room(room_name, group)
35
 function get_room(room_name, group)
30
     local room_address = jid.join(room_name, module:get_host());
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
         room_address = "["..group.."]"..room_address;
40
         room_address = "["..group.."]"..room_address;
34
     end
41
     end
35
 
42
 
92
     if (session.jitsi_meet_context_user) then
99
     if (session.jitsi_meet_context_user) then
93
         local room = get_room(
100
         local room = get_room(
94
             session.jitsi_bosh_query_room,
101
             session.jitsi_bosh_query_room,
95
-            session.jitsi_meet_context_group);
102
+            session.jitsi_meet_domain);
96
 
103
 
97
         if (not room) then
104
         if (not room) then
98
             return nil;
105
             return nil;

Loading…
İptal
Kaydet