瀏覽代碼

fix: Clear prosody utils and removes a debug statement.

j8
damencho 3 年之前
父節點
當前提交
53cea31bb8
共有 2 個文件被更改,包括 3 次插入13 次删除
  1. 0
    2
      resources/prosody-plugins/mod_muc_domain_mapper.lua
  2. 3
    11
      resources/prosody-plugins/util.lib.lua

+ 0
- 2
resources/prosody-plugins/mod_muc_domain_mapper.lua 查看文件

@@ -3,8 +3,6 @@
3 3
 
4 4
 -- It is recommended to set muc_mapper_domain_base to the main domain being served (example.com)
5 5
 
6
-local jid = require "util.jid";
7
-
8 6
 local filters = require "util.filters";
9 7
 
10 8
 local muc_domain_base = module:get_option_string("muc_mapper_domain_base");

+ 3
- 11
resources/prosody-plugins/util.lib.lua 查看文件

@@ -63,9 +63,8 @@ local function room_jid_match_rewrite(room_jid, stanza)
63 63
             roomless_iqs[stanza.attr.id] = stanza.attr.to;
64 64
         end
65 65
     end
66
-    room_jid = jid.join(new_node, new_host, new_resource);
67
-    -- module:log("debug", "Rewrote to %s", room_jid);
68
-    return room_jid
66
+
67
+    return jid.join(new_node, new_host, new_resource);
69 68
 end
70 69
 
71 70
 -- Utility function to check and convert a room JID from real [foo]room1@muc.example.com to virtual room1@muc.foo.example.com
@@ -90,10 +89,7 @@ local function internal_room_jid_match_rewrite(room_jid, stanza)
90 89
     end
91 90
 
92 91
     -- Ok, rewrite room_jid address to pretty format
93
-    local new_node, new_host, new_resource = target_node, muc_domain_prefix..".".. target_subdomain.."."..muc_domain_base, resource;
94
-    room_jid = jid.join(new_node, new_host, new_resource);
95
-    -- module:log("debug", "Rewrote to %s", room_jid);
96
-    return room_jid
92
+    return jid.join(target_node, muc_domain_prefix..".".. target_subdomain.."."..muc_domain_base, resource);
97 93
 end
98 94
 
99 95
 --- Finds and returns room by its jid
@@ -199,8 +195,6 @@ function update_presence_identity(
199 195
             return tag
200 196
         end
201 197
     )
202
-    module:log("debug",
203
-        "Presence after previous identity stripped: %s", tostring(stanza));
204 198
 
205 199
     stanza:tag("identity"):tag("user");
206 200
     for k, v in pairs(user) do
@@ -229,8 +223,6 @@ function update_presence_identity(
229 223
         stanza:up();
230 224
     end
231 225
 
232
-    module:log("debug",
233
-        "Presence with identity inserted %s", tostring(stanza))
234 226
 end
235 227
 
236 228
 -- Utility function to check whether feature is present and enabled. Allow

Loading…
取消
儲存