소스 검색

use proper message timestamp

j8
isymchych 9 년 전
부모
커밋
e666ed70f7
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      app.js
  2. 5
    0
      lib-jitsi-meet.js

+ 2
- 2
app.js 파일 보기

@@ -307,8 +307,8 @@ function initConference(localTracks, connection) {
307 307
         APP.UI.addListener(UIEvents.MESSAGE_CREATED, function (message) {
308 308
             room.sendTextMessage(message);
309 309
         });
310
-        room.on(ConferenceEvents.MESSAGE_RECEIVED, function (userId, text) {
311
-            APP.UI.addMessage(userId, getDisplayName(userId), text, Date.now());
310
+        room.on(ConferenceEvents.MESSAGE_RECEIVED, function (id, text, ts) {
311
+            APP.UI.addMessage(id, getDisplayName(id), text, ts);
312 312
         });
313 313
     }
314 314
 

+ 5
- 0
lib-jitsi-meet.js 파일 보기

@@ -501,6 +501,11 @@ function setupListeners(conference) {
501 501
         conference.eventEmitter.emit(JitsiConferenceEvents.SETUP_FAILED);
502 502
     });
503 503
 
504
+    conference.room.addListener(XMPPEvents.MESSAGE_RECEIVED, function (jid, displayName, txt, myJid, ts) {
505
+        var id = Strophe.getResourceFromJid(jid);
506
+        conference.eventEmitter.emit(JitsiConferenceEvents.MESSAGE_RECEIVED, id, txt, ts);
507
+    });
508
+
504 509
     conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
505 510
         if(conference.lastActiveSpeaker !== id && conference.room) {
506 511
             conference.lastActiveSpeaker = id;

Loading…
취소
저장