diff --git a/app.js b/app.js index 4a86b546a..89db9e41e 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,8 @@ var APP = this.keyboardshortcut = require("./modules/keyboardshortcut/keyboardshortcut"); this.translation = require("./modules/translation/translation"); this.settings = require("./modules/settings/Settings"); + this.DTMF = require("./modules/DTMF/DTMF"); + this.members = require("./modules/members/MemberList"); } }; @@ -29,6 +31,7 @@ function init() { APP.desktopsharing.init(); APP.keyboardshortcut.init(); + APP.members.start(); } diff --git a/css/font.css b/css/font.css index 49ebc90c6..d7a1d82ed 100644 --- a/css/font.css +++ b/css/font.css @@ -119,4 +119,8 @@ .icon-settings:before { content: "\e61b"; -} \ No newline at end of file +} + +.icon-dialPad:before { + content: "\e61c"; +} diff --git a/doc/adding-an-icon.md b/doc/adding-an-icon.md new file mode 100644 index 000000000..be19a6b5f --- /dev/null +++ b/doc/adding-an-icon.md @@ -0,0 +1,12 @@ +### Adding an icon to the font file (e.g. for the floating menu) +1. Go to https://icomoon.io/app/ +2. Go to "Manage Projects" from the menu on the top left. +3. Use "Import project" and select fonts/selection.json from Jitsi Meet. +4. Import icons (e.g. svg files) using the "import items" button. +5. Go to "generate font" and make sure the identifiers for the new icons are correct. +6. Download the result in a zip file using the "download" button. +7. Copy selection.json and fonts/jitsi.* from the zip file to fonts/ in Jitsi Meet +8. Copy the class for the new icon from style.css in the zip file to css/font.css in Jitsi Meet (do *not* copy the whole file) + +Sample commit: https://github.com/jitsi/jitsi-meet/commit/68bc819b89aec12364fcf07b81efa83a1900eed6 + diff --git a/fonts/jitsi.eot b/fonts/jitsi.eot index d85113241..76d3bb429 100644 Binary files a/fonts/jitsi.eot and b/fonts/jitsi.eot differ diff --git a/fonts/jitsi.svg b/fonts/jitsi.svg index 19ef9bd0a..b78a3ebb0 100644 --- a/fonts/jitsi.svg +++ b/fonts/jitsi.svg @@ -35,4 +35,5 @@ + \ No newline at end of file diff --git a/fonts/jitsi.ttf b/fonts/jitsi.ttf index e3d1af5c6..bb7402098 100644 Binary files a/fonts/jitsi.ttf and b/fonts/jitsi.ttf differ diff --git a/fonts/jitsi.woff b/fonts/jitsi.woff index a6df0b031..0551381e1 100644 Binary files a/fonts/jitsi.woff and b/fonts/jitsi.woff differ diff --git a/fonts/selection.json b/fonts/selection.json index 9d8efb6e7..696fa39e3 100644 --- a/fonts/selection.json +++ b/fonts/selection.json @@ -1,6 +1,59 @@ { "IcoMoonType": "selection", "icons": [ + { + "icon": { + "paths": [ + "M74.418 78.701h239.304v228.491h-239.304v-228.491z", + "M393.455 78.701h239.304v228.491h-239.304v-228.491z", + "M712.494 78.701h239.263v228.491h-239.263v-228.491z", + "M74.418 397.735h239.304v228.555h-239.304v-228.555z", + "M393.455 397.735h239.304v228.555h-239.304v-228.555z", + "M712.494 397.735h239.263v228.555h-239.263v-228.555z", + "M74.418 716.834h239.304v228.465h-239.304v-228.465z", + "M393.455 716.834h239.304v228.465h-239.304v-228.465z", + "M712.494 716.834h239.263v228.465h-239.263v-228.465z" + ], + "attrs": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {} + ], + "isMulticolor": false, + "width": 1026, + "grid": 0, + "tags": [ + "dailPad" + ] + }, + "attrs": [ + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {} + ], + "properties": { + "order": 29, + "id": 0, + "prevSize": 32, + "code": 58908, + "name": "dialPad" + }, + "setIdx": 0, + "setId": 2, + "iconIdx": 0 + }, { "icon": { "paths": [ @@ -31,7 +84,8 @@ "code": 58907, "name": "settings" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 0 }, { @@ -74,7 +128,8 @@ "name": "webCam", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 1 }, { @@ -144,7 +199,8 @@ "name": "connection", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 2 }, { @@ -168,7 +224,8 @@ "name": "filmstrip", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 3 }, { @@ -194,7 +251,8 @@ "name": "reload", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 4 }, { @@ -218,7 +276,8 @@ "name": "hangup", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 5 }, { @@ -242,7 +301,8 @@ "name": "contactList", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 6 }, { @@ -267,7 +327,8 @@ "name": "avatar", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 7 }, { @@ -292,7 +353,8 @@ "name": "callRetro", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 8 }, { @@ -317,7 +379,8 @@ "name": "callModern", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 9 }, { @@ -343,7 +406,8 @@ "name": "recDisable", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 10 }, { @@ -370,7 +434,8 @@ "name": "recEnable", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 11 }, { @@ -395,7 +460,8 @@ "name": "kick1", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 12 }, { @@ -421,7 +487,8 @@ "name": "kick", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 13 }, { @@ -447,7 +514,8 @@ "name": "share-desktop", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 14 }, { @@ -471,7 +539,8 @@ "name": "chat-simple", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 15 }, { @@ -497,7 +566,8 @@ "name": "full-screen", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 16 }, { @@ -523,7 +593,8 @@ "name": "exit-full-screen", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 17 }, { @@ -552,7 +623,8 @@ "name": "prezi", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 18 }, { @@ -595,7 +667,8 @@ "name": "addNew-V5", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 19 }, { @@ -621,7 +694,8 @@ "name": "chat", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 20 }, { @@ -648,7 +722,8 @@ "name": "presentation", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 21 }, { @@ -672,7 +747,8 @@ "name": "security", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 22 }, { @@ -697,7 +773,8 @@ "name": "share-doc", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 23 }, { @@ -721,7 +798,8 @@ "name": "security-locked", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 24 }, { @@ -746,7 +824,8 @@ "name": "camera-disabled", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 25 }, { @@ -772,7 +851,8 @@ "name": "mic-disabled", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 26 }, { @@ -797,7 +877,8 @@ "name": "microphone", "ligatures": "" }, - "setIdx": 0, + "setIdx": 1, + "setId": 1, "iconIdx": 27 } ], diff --git a/index.html b/index.html index 20433aabd..d68933057 100644 --- a/index.html +++ b/index.html @@ -201,6 +201,11 @@ +
diff --git a/lang/main.json b/lang/main.json index 06bdf86f5..c5da849f9 100644 --- a/lang/main.json +++ b/lang/main.json @@ -62,7 +62,8 @@ "Settings": "Settings", "hangup": "Hang Up", "login": "Login", - "logout": "Logout" + "logout": "Logout", + "dialpad": "Show dialpad" }, "bottomtoolbar": { "chat": "Open / close chat", diff --git a/modules/API/API.js b/modules/API/API.js index 9be9648b5..44256ff7b 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -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) { diff --git a/modules/DTMF/DTMF.js b/modules/DTMF/DTMF.js new file mode 100644 index 000000000..e4ce2057c --- /dev/null +++ b/modules/DTMF/DTMF.js @@ -0,0 +1,47 @@ +/* global APP */ + +/** + * A module for sending DTMF tones. + */ +var DTMFSender; +var initDtmfSender = function() { + // TODO: This needs to reset this if the peerconnection changes + // (e.g. the call is re-made) + if (DTMFSender) + return; + + var localAudio = APP.RTC.localAudio; + if (localAudio && localAudio.getTracks().length > 0) + { + var peerconnection + = APP.xmpp.getConnection().jingle.activecall.peerconnection; + if (peerconnection) { + DTMFSender = + peerconnection.peerconnection + .createDTMFSender(localAudio.getTracks()[0]); + console.log("Initialized DTMFSender"); + } + else { + console.log("Failed to initialize DTMFSender: no PeerConnection."); + } + } + else { + console.log("Failed to initialize DTMFSender: no audio track."); + } +}; + +var DTMF = { + sendTones: function (tones, duration, pause) { + if (!DTMFSender) + initDtmfSender(); + + if (DTMFSender){ + DTMFSender.insertDTMF(tones, + (duration || 200), + (pause || 200)); + } + } +}; + +module.exports = DTMF; + diff --git a/modules/RTC/RTC.js b/modules/RTC/RTC.js index ad819d54a..6a9d95a59 100644 --- a/modules/RTC/RTC.js +++ b/modules/RTC/RTC.js @@ -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") { diff --git a/modules/UI/UI.js b/modules/UI/UI.js index b37d94615..b7b70cd87 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -26,6 +26,7 @@ var DesktopSharingEventTypes var RTCEvents = require("../../service/RTC/RTCEvents"); var StreamEventTypes = require("../../service/RTC/StreamEventTypes"); var XMPPEvents = require("../../service/xmpp/XMPPEvents"); +var MemberEvents = require("../../service/members/Events"); var eventEmitter = new EventEmitter(); var roomName = null; @@ -185,7 +186,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,14 +208,14 @@ 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.PASSWORD_REQUIRED, onPasswordReqiured); + 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); APP.xmpp.addListener(XMPPEvents.AUTHENTICATION_REQUIRED, @@ -224,6 +225,8 @@ function registerListeners() { VideoLayout.setDeviceAvailabilityIcons(resource, devices); }); + APP.members.addListener(MemberEvents.DTMF_SUPPORT_CHANGED, + onDtmfSupportChanged); } @@ -417,7 +420,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 +447,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); @@ -473,7 +476,7 @@ function onModeratorStatusChanged(isModerator) { } }; -function onPasswordReqiured(callback) { +function onPasswordRequired(callback) { // password is required Toolbar.lockLockButton(); var message = '

'; @@ -502,7 +505,17 @@ function onPasswordReqiured(callback) { ':input:first' ); } -function onMucEntered(jid, id, displayName) { + +/** + * The dialpad button is shown iff there is at least one member that supports + * DTMF (e.g. jigasi). + */ +function onDtmfSupportChanged(dtmfSupport) { + //TODO: enable when the UI is ready + //Toolbar.showDialPadButton(dtmfSupport); +} + +function onMucMemberJoined(jid, id, displayName) { messageHandler.notify(displayName,'notify.somebody', 'connected', 'notify.connected'); diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 1ed5497a7..9df68bd22 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -54,6 +54,9 @@ var buttonHandlers = "toolbar_button_sip": function () { return callSipButtonClicked(); }, + "toolbar_button_dialpad": function () { + return dialpadButtonClicked(); + }, "toolbar_button_settings": function () { PanelToggler.toggleSettingsMenu(); }, @@ -221,6 +224,11 @@ function inviteParticipants() { window.open("mailto:?subject=" + subject + "&body=" + body, '_blank'); } +function dialpadButtonClicked() +{ + //TODO show the dialpad window +} + function callSipButtonClicked() { var defaultNumber @@ -549,12 +557,13 @@ var Toolbar = (function (my) { // Sets the state of the recording button my.setRecordingButtonState = function (isRecording) { + var selector = $('#recordButton'); if (isRecording) { - $('#recordButton').removeClass("icon-recEnable"); - $('#recordButton').addClass("icon-recEnable active"); + selector.removeClass("icon-recEnable"); + selector.addClass("icon-recEnable active"); } else { - $('#recordButton').removeClass("icon-recEnable active"); - $('#recordButton').addClass("icon-recEnable"); + selector.removeClass("icon-recEnable active"); + selector.addClass("icon-recEnable"); } }; @@ -567,14 +576,24 @@ var Toolbar = (function (my) { } }; + // Shows or hides the dialpad button + my.showDialPadButton = function (show) { + if (show) { + $('#dialPadButton').css({display: "inline-block"}); + } else { + $('#dialPadButton').css({display: "none"}); + } + }; + /** * Displays user authenticated identity name(login). * @param authIdentity identity name to be displayed. */ my.setAuthenticatedIdentity = function (authIdentity) { if (authIdentity) { - $('#toolbar_auth_identity').css({display: "list-item"}); - $('#toolbar_auth_identity').text(authIdentity); + var selector = $('#toolbar_auth_identity'); + selector.css({display: "list-item"}); + selector.text(authIdentity); } else { $('#toolbar_auth_identity').css({display: "none"}); } diff --git a/modules/members/MemberList.js b/modules/members/MemberList.js new file mode 100644 index 000000000..343d98f02 --- /dev/null +++ b/modules/members/MemberList.js @@ -0,0 +1,123 @@ +/* global APP */ + +/** + * This module is meant to (eventually) contain and manage all information + * about members/participants of the conference, so that other modules don't + * have to do it on their own, and so that other modules can access members' + * information from a single place. + * + * Currently this module only manages information about the support of jingle + * DTMF of the members. Other fields, as well as accessor methods are meant to + * be added as needed. + */ + +var XMPPEvents = require("../../service/xmpp/XMPPEvents"); +var Events = require("../../service/members/Events"); +var EventEmitter = require("events"); + +var eventEmitter = new EventEmitter(); + +/** + * The actual container. + */ +var members = {}; + +/** + * There is at least one member that supports DTMF (i.e. is jigasi). + */ +var atLeastOneDtmf = false; + + +function registerListeners() { + APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_JOINED, onMucMemberJoined); + APP.xmpp.addListener(XMPPEvents.MUC_MEMBER_LEFT, onMucMemberLeft); +} + +/** + * Handles a new member joining the MUC. + */ +function onMucMemberJoined(jid, id, displayName) { + var member = { + displayName: displayName + }; + + APP.xmpp.getConnection().disco.info( + jid, "" /* node */, function(iq) { onDiscoInfoReceived(jid, iq); }); + + members[jid] = member; +} + +/** + * Handles a member leaving the MUC. + */ +function onMucMemberLeft(jid) { + delete members[jid]; + updateAtLeastOneDtmf(); +} + +/** + * Handles the reception of a disco#info packet from a particular JID. + * @param jid the JID sending the packet. + * @param iq the packet. + */ +function onDiscoInfoReceived(jid, iq) { + if (!members[jid]) + return; + + var supportsDtmf + = $(iq).find('>query>feature[var="urn:xmpp:jingle:dtmf:0"]').length > 0; + updateDtmf(jid, supportsDtmf); +} + +/** + * Updates the 'supportsDtmf' field for a member. + * @param jid the jid of the member. + * @param newValue the new value for the 'supportsDtmf' field. + */ +function updateDtmf(jid, newValue) { + var oldValue = members[jid].supportsDtmf; + members[jid].supportsDtmf = newValue; + + if (newValue != oldValue) { + updateAtLeastOneDtmf(); + } +} + +/** + * Checks each member's 'supportsDtmf' field and updates + * 'atLastOneSupportsDtmf'. + */ +function updateAtLeastOneDtmf(){ + var newAtLeastOneDtmf = false; + for (var key in members) { + if (typeof members[key].supportsDtmf !== 'undefined' + && members[key].supportsDtmf) { + newAtLeastOneDtmf= true; + break; + } + } + + if (atLeastOneDtmf != newAtLeastOneDtmf) { + atLeastOneDtmf = newAtLeastOneDtmf; + eventEmitter.emit(Events.DTMF_SUPPORT_CHANGED, atLeastOneDtmf); + } +} + + +/** + * Exported interface. + */ +var Members = { + start: function(){ + registerListeners(); + }, + addListener: function(type, listener) + { + eventEmitter.on(type, listener); + }, + removeListener: function (type, listener) { + eventEmitter.removeListener(type, listener); + } +}; + +module.exports = Members; diff --git a/modules/xmpp/moderator.js b/modules/xmpp/moderator.js index 1dd1b840b..8f67a326b 100644 --- a/modules/xmpp/moderator.js +++ b/modules/xmpp/moderator.js @@ -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) { diff --git a/modules/xmpp/strophe.emuc.js b/modules/xmpp/strophe.emuc.js index 76d87d40a..5df72a4a6 100644 --- a/modules/xmpp/strophe.emuc.js +++ b/modules/xmpp/strophe.emuc.js @@ -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 @@ -588,7 +588,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); @@ -597,7 +597,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) { @@ -632,7 +632,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); diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js index b051fa92b..af6bbbf56 100644 --- a/modules/xmpp/xmpp.js +++ b/modules/xmpp/xmpp.js @@ -142,6 +142,7 @@ function setupEvents() { } var XMPP = { + getConnection: function(){ return connection; }, sessionTerminated: false, /** diff --git a/service/members/Events.js b/service/members/Events.js new file mode 100644 index 000000000..02b006b7f --- /dev/null +++ b/service/members/Events.js @@ -0,0 +1,5 @@ +var Events = { + DTMF_SUPPORT_CHANGED: "members.dtmf_support_changed" +}; + +module.exports = Events; diff --git a/service/xmpp/XMPPEvents.js b/service/xmpp/XMPPEvents.js index 1ebdd6b40..0597182f4 100644 --- a/service/xmpp/XMPPEvents.js +++ b/service/xmpp/XMPPEvents.js @@ -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",