Fix typos and rename event names for purposes of clarity.

This commit is contained in:
Boris Grozev 2015-04-08 12:30:10 +02:00
parent 99b1a51df0
commit 886fb2ac43
6 changed files with 25 additions and 22 deletions

View File

@ -135,7 +135,7 @@ function processMessage(event)
}
function setupListeners() {
APP.xmpp.addListener(XMPPEvents.MUC_ENTER, function (from) {
APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_JOINED, function (from) {
API.triggerEvent("participantJoined", {jid: from});
});
APP.xmpp.addListener(XMPPEvents.MESSAGE_RECEIVED, function (from, nick, txt, myjid) {
@ -143,7 +143,7 @@ function setupListeners() {
API.triggerEvent("incomingMessage",
{"from": from, "nick": nick, "message": txt});
});
APP.xmpp.addListener(XMPPEvents.MUC_LEFT, function (jid) {
APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_LEFT, function (jid) {
API.triggerEvent("participantLeft", {jid: jid});
});
APP.xmpp.addListener(XMPPEvents.DISPLAY_NAME_CHANGED, function (jid, newDisplayName) {

View File

@ -117,7 +117,7 @@ var RTC = {
function (stream, isUsingScreenStream, callback) {
self.changeLocalVideo(stream, isUsingScreenStream, callback);
}, DesktopSharingEventTypes.NEW_STREAM_CREATED);
APP.xmpp.addListener(XMPPEvents.CHANGED_STREAMS, function (jid, changedStreams) {
APP.xmpp.addListener(XMPPEvents.STREAMS_CHANGED, function (jid, changedStreams) {
for(var i = 0; i < changedStreams.length; i++) {
var type = changedStreams[i].type;
if (type != "audio") {

View File

@ -185,7 +185,7 @@ function registerListeners() {
APP.xmpp.addListener(XMPPEvents.USER_ID_CHANGED, function (from, id) {
Avatar.setUserAvatar(from, id);
});
APP.xmpp.addListener(XMPPEvents.CHANGED_STREAMS, function (jid, changedStreams) {
APP.xmpp.addListener(XMPPEvents.STREAMS_CHANGED, function (jid, changedStreams) {
for(stream in changedStreams)
{
// might need to update the direction if participant just went from sendrecv to recvonly
@ -207,13 +207,13 @@ function registerListeners() {
});
APP.xmpp.addListener(XMPPEvents.DISPLAY_NAME_CHANGED, onDisplayNameChanged);
APP.xmpp.addListener(XMPPEvents.MUC_JOINED, onMucJoined);
APP.xmpp.addListener(XMPPEvents.LOCALROLE_CHANGED, onLocalRoleChange);
APP.xmpp.addListener(XMPPEvents.MUC_ENTER, onMucEntered);
APP.xmpp.addListener(XMPPEvents.LOCAL_ROLE_CHANGED, onLocalRoleChanged);
APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_JOINED, onMucMemberJoined);
APP.xmpp.addListener(XMPPEvents.MUC_ROLE_CHANGED, onMucRoleChanged);
APP.xmpp.addListener(XMPPEvents.PRESENCE_STATUS, onMucPresenceStatus);
APP.xmpp.addListener(XMPPEvents.SUBJECT_CHANGED, chatSetSubject);
APP.xmpp.addListener(XMPPEvents.MESSAGE_RECEIVED, updateChatConversation);
APP.xmpp.addListener(XMPPEvents.MUC_LEFT, onMucLeft);
APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_LEFT, onMucMemberLeft);
APP.xmpp.addListener(XMPPEvents.PASSWORD_REQUIRED, onPasswordRequired);
APP.xmpp.addListener(XMPPEvents.CHAT_ERROR_RECEIVED, chatAddError);
APP.xmpp.addListener(XMPPEvents.ETHERPAD, initEtherpad);
@ -417,7 +417,7 @@ function initEtherpad(name) {
Etherpad.init(name);
};
function onMucLeft(jid) {
function onMucMemberLeft(jid) {
console.log('left.muc', jid);
var displayName = $('#participant_' + Strophe.getResourceFromJid(jid) +
'>.displayname').html();
@ -444,7 +444,7 @@ function onMucLeft(jid) {
};
function onLocalRoleChange(jid, info, pres, isModerator)
function onLocalRoleChanged(jid, info, pres, isModerator)
{
console.info("My role changed, new role: " + info.role);
@ -502,7 +502,7 @@ function onPasswordRequired(callback) {
':input:first'
);
}
function onMucEntered(jid, id, displayName) {
function onMucMemberJoined(jid, id, displayName) {
messageHandler.notify(displayName,'notify.somebody',
'connected',
'notify.connected');

View File

@ -85,7 +85,7 @@ var Moderator = {
}
},
onMucLeft: function (jid) {
onMucMemberLeft: function (jid) {
console.info("Someone left is it focus ? " + jid);
var resource = Strophe.getResourceFromJid(jid);
if (resource === 'focus' && !this.xmppService.sessionTerminated) {

View File

@ -201,7 +201,7 @@ module.exports = function(XMPP, eventEmitter) {
if (this.role !== member.role) {
this.role = member.role;
eventEmitter.emit(XMPPEvents.LOCALROLE_CHANGED,
eventEmitter.emit(XMPPEvents.LOCAL_ROLE_CHANGED,
from, member, pres, Moderator.isModerator());
}
if (!this.joined) {
@ -224,7 +224,7 @@ module.exports = function(XMPP, eventEmitter) {
if (email.length > 0) {
id = email.text();
}
eventEmitter.emit(XMPPEvents.MUC_ENTER, from, id, member.displayName);
eventEmitter.emit(XMPPEvents.MUC_MEMBER_JOINED, from, id, member.displayName);
}
} else {
// Presence update for existing participant
@ -584,7 +584,7 @@ module.exports = function(XMPP, eventEmitter) {
},
onParticipantLeft: function (jid) {
eventEmitter.emit(XMPPEvents.MUC_LEFT, jid);
eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, jid);
this.connection.jingle.terminateByJid(jid);
@ -593,7 +593,7 @@ module.exports = function(XMPP, eventEmitter) {
[jid, this.getPrezi(jid)]);
}
Moderator.onMucLeft(jid);
Moderator.onMucMemberLeft(jid);
},
parsePresence: function (from, memeber, pres) {
if($(pres).find(">bridgeIsDown").length > 0 && !bridgeIsDown) {
@ -628,7 +628,7 @@ module.exports = function(XMPP, eventEmitter) {
});
eventEmitter.emit(XMPPEvents.CHANGED_STREAMS, from, changedStreams);
eventEmitter.emit(XMPPEvents.STREAMS_CHANGED, from, changedStreams);
var displayName = !config.displayJids
? memeber.displayName : Strophe.getResourceFromJid(from);

View File

@ -1,21 +1,24 @@
var XMPPEvents = {
CONFERENCE_CERATED: "xmpp.conferenceCreated.jingle",
CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
CALL_TERMINATED: "xmpp.callterminated.jingle",
CALL_INCOMING: "xmpp.callincoming.jingle",
DISPOSE_CONFERENCE: "xmpp.dispoce_confernce",
DISPOSE_CONFERENCE: "xmpp.dispose_conference",
GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown",
KICKED: "xmpp.kicked",
BRIDGE_DOWN: "xmpp.bridge_down",
USER_ID_CHANGED: "xmpp.user_id_changed",
CHANGED_STREAMS: "xmpp.changed_streams",
STREAMS_CHANGED: "xmpp.streams_changed",
// We joined the MUC
MUC_JOINED: "xmpp.muc_joined",
MUC_ENTER: "xmpp.muc_enter",
// A member joined the MUC
MUC_MEMBER_JOINED: "xmpp.muc_member_joined",
// A member left the MUC
MUC_MEMBER_LEFT: "xmpp.muc_member_left",
MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
MUC_LEFT: "xmpp.muc_left",
MUC_DESTROYED: "xmpp.muc_destroyed",
DISPLAY_NAME_CHANGED: "xmpp.display_name_changed",
REMOTE_STATS: "xmpp.remote_stats",
LOCALROLE_CHANGED: "xmpp.localrole_changed",
LOCAL_ROLE_CHANGED: "xmpp.localrole_changed",
PRESENCE_STATUS: "xmpp.presence_status",
RESERVATION_ERROR: "xmpp.room_reservation_error",
SUBJECT_CHANGED: "xmpp.subject_changed",