use proper message timestamp

This commit is contained in:
isymchych 2015-12-14 18:12:10 +02:00
parent 4f91ac01fd
commit e666ed70f7
2 changed files with 7 additions and 2 deletions

4
app.js
View File

@ -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);
});
}

View File

@ -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;