소스 검색

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

Loading…
취소
저장