fix issue with nickname input in chat

This commit is contained in:
isymchych 2015-12-14 18:54:08 +02:00
parent e666ed70f7
commit fbe5ef7ee6
3 changed files with 6 additions and 4 deletions

1
app.js
View File

@ -375,6 +375,7 @@ function initConference(localTracks, connection) {
APP.UI.addListener(UIEvents.NICKNAME_CHANGED, function (nickname) {
APP.settings.setDisplayName(nickname);
room.setDisplayName(nickname);
APP.UI.changeDisplayName(APP.conference.localId, nickname);
});
room.on(ConferenceErrors.CONNECTION_ERROR, function () {

View File

@ -155,6 +155,10 @@ UI.changeDisplayName = function (id, displayName) {
ContactList.onDisplayNameChange(id, displayName);
SettingsMenu.onDisplayNameChange(id, displayName);
VideoLayout.onDisplayNameChanged(id, displayName);
if (APP.conference.isLocalId(id)) {
Chat.setChatConversationMode(!!displayName);
}
};
UI.initConference = function () {

View File

@ -181,10 +181,7 @@ var Chat = {
event.preventDefault();
var val = UIUtil.escapeHtml(this.value);
this.value = '';
if (APP.settings.getDisplayName()) {
eventEmitter.emit(UIEvents.NICKNAME_CHANGED, val);
return;
}
eventEmitter.emit(UIEvents.NICKNAME_CHANGED, val);
}
});