Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

use proper message timestamp

isymchyche666ed70f7c9
diff --git a/app.js b/app.js
index 95ab12dda6..84e577dee9 100644
--- a/app.js
+++ b/app.js
@@ -307,8 +307,8 @@ function initConference(localTracks, connection) {
APP.UI.addListener(UIEvents.MESSAGE_CREATED, function (message) {
room.sendTextMessage(message);
});
- room.on(ConferenceEvents.MESSAGE_RECEIVED, function (userId, text) {
- APP.UI.addMessage(userId, getDisplayName(userId), text, Date.now());
+ room.on(ConferenceEvents.MESSAGE_RECEIVED, function (id, text, ts) {
+ APP.UI.addMessage(id, getDisplayName(id), text, ts);
});
}
diff --git a/lib-jitsi-meet.js b/lib-jitsi-meet.js
index 415ce2224b..ccd575b05d 100644
--- a/lib-jitsi-meet.js
+++ b/lib-jitsi-meet.js
@@ -501,6 +501,11 @@ function setupListeners(conference) {
conference.eventEmitter.emit(JitsiConferenceEvents.SETUP_FAILED);
});
+ conference.room.addListener(XMPPEvents.MESSAGE_RECEIVED, function (jid, displayName, txt, myJid, ts) {
+ var id = Strophe.getResourceFromJid(jid);
+ conference.eventEmitter.emit(JitsiConferenceEvents.MESSAGE_RECEIVED, id, txt, ts);
+ });
+
conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
if(conference.lastActiveSpeaker !== id && conference.room) {
conference.lastActiveSpeaker = id;