浏览代码

fix(call-flows): Maintain presence tags and call id in poltergeist presence stanza.

master
Jacob MacElroy 7 年前
父节点
当前提交
83720a4ed5
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8
    1
      resources/prosody-plugins/mod_muc_poltergeist.lua

+ 8
- 1
resources/prosody-plugins/mod_muc_poltergeist.lua 查看文件

@@ -241,8 +241,14 @@ function create_poltergeist_occupant(room, nick, name, avatar, status, context)
241 241
         join:tag("password", { xmlns = MUC_NS }):text(room_password);
242 242
     end
243 243
 
244
+    -- Update the nil call id to the initial call id for call flows.
244 245
 	local call_id = get_username(room, context.user.id);
245
-	join_presence:tag("call_id"):text(get_username(room, context.user.id)):up();
246
+    join_presence:maptags(function (tag)
247
+        if tag.name == "call_id" then
248
+           return st.stanza("call_id"):text(call_id);
249
+        end
250
+        return tag;
251
+    end);
246 252
 
247 253
     update_presence_identity(
248 254
         join_presence,
@@ -356,6 +362,7 @@ function update_presence_tags(presence_stanza, status, call_details)
356 362
                 return st.stanza("call_cancel"):text("false");
357 363
             end
358 364
         end
365
+        return tag;
359 366
     end);
360 367
 
361 368
     return presence_stanza

正在加载...
取消
保存