propagate MESSAGE_RECEIVED event

This commit is contained in:
isymchych 2015-12-14 18:07:49 +02:00
parent e59196e824
commit 05d84c25db
3 changed files with 11 additions and 1 deletions

View File

@ -499,6 +499,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;

View File

@ -71,7 +71,7 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
- ACTIVE_SPEAKER_CHANGED - the active speaker is changed. (parameters - id(string))
- USER_JOINED - new user joined a conference. (parameters - id(string), user(JitsiParticipant))
- USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
- MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string))
- MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
- DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
- LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - array of ids of users)
- IN_LAST_N_CHANGED - passes boolean property that shows whether the local user is included in last n set of any other user or not. (parameters - boolean)

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;