From 29fa4c935e9449f000d23801e001663ab882ec74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 12 Nov 2020 09:36:09 +0100 Subject: [PATCH] fix(chat) stop using nicknames We stopped providing a way to set them, so don't render them either. Also cleanup some leftover config options. --- config.js | 1 - doc/example-config-files/config.js.example | 1 - .../multidomain/config.js.multidomain.example | 1 - modules/UI/UI.js | 5 ----- react/features/base/config/configWhitelist.js | 1 - react/features/chat/middleware.js | 13 +++++-------- 6 files changed, 5 insertions(+), 17 deletions(-) diff --git a/config.js b/config.js index 174c12519..2ccb6335c 100644 --- a/config.js +++ b/config.js @@ -678,7 +678,6 @@ var config = { forceJVB121Ratio hiddenDomain ignoreStartMuted - nick startBitrate */ diff --git a/doc/example-config-files/config.js.example b/doc/example-config-files/config.js.example index 92f71cfed..bbd7656e8 100755 --- a/doc/example-config-files/config.js.example +++ b/doc/example-config-files/config.js.example @@ -4,6 +4,5 @@ var config = { muc: 'conference.jitsi.example.com', // FIXME: use XEP-0030 bridge: 'jitsi-videobridge.jitsi.example.com' // FIXME: use XEP-0030 }, - useNicks: false, bosh: '//jitsi.example.com/http-bind' // FIXME: use xep-0156 for that }; diff --git a/doc/example-config-files/multidomain/config.js.multidomain.example b/doc/example-config-files/multidomain/config.js.multidomain.example index 1479c42d1..5be61141a 100644 --- a/doc/example-config-files/multidomain/config.js.multidomain.example +++ b/doc/example-config-files/multidomain/config.js.multidomain.example @@ -9,7 +9,6 @@ var config = { muc: 'conference.'+subdomain+'jitsi.example.com', // FIXME: use XEP-0030 focus: 'focus.jitsi.example.com', }, - useNicks: false, bosh: '//jitsi.example.com/http-bind', // FIXME: use xep-0156 for that websocket: 'wss://jitsi.example.com/xmpp-websocket' }; diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 035ba11af..94f7bb80a 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -343,11 +343,6 @@ UI.showLoginPopup = function(callback) { }); }; -UI.askForNickname = function() { - // eslint-disable-next-line no-alert - return window.prompt('Your nickname (optional)'); -}; - /** * Sets muted audio state for participant */ diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index c29c32025..0fcad430c 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -128,7 +128,6 @@ export default [ 'localRecording', 'maxFullResolutionParticipants', 'minParticipants', - 'nick', 'openBridgeChannel', 'opusMaxAverageBitrate', 'p2p', diff --git a/react/features/chat/middleware.js b/react/features/chat/middleware.js index 4a44f0690..04719829c 100644 --- a/react/features/chat/middleware.js +++ b/react/features/chat/middleware.js @@ -161,11 +161,10 @@ function _addChatMsgListener(conference, store) { conference.on( JitsiConferenceEvents.MESSAGE_RECEIVED, - (id, message, timestamp, nick) => { + (id, message, timestamp) => { _handleReceivedMessage(store, { id, message, - nick, privateMessage: false, timestamp }); @@ -179,8 +178,7 @@ function _addChatMsgListener(conference, store) { id, message, privateMessage: true, - timestamp, - nick: undefined + timestamp }); } ); @@ -215,7 +213,7 @@ function _handleChatError({ dispatch }, error) { * @param {Object} message - The message object. * @returns {void} */ -function _handleReceivedMessage({ dispatch, getState }, { id, message, nick, privateMessage, timestamp }) { +function _handleReceivedMessage({ dispatch, getState }, { id, message, privateMessage, timestamp }) { // Logic for all platforms: const state = getState(); const { isOpen: isChatOpen } = state['features/chat']; @@ -228,10 +226,9 @@ function _handleReceivedMessage({ dispatch, getState }, { id, message, nick, pri // backfilled for a participant that has left the conference. const participant = getParticipantById(state, id) || {}; const localParticipant = getLocalParticipant(getState); - const displayName = participant.name || nick || getParticipantDisplayName(state, id); + const displayName = getParticipantDisplayName(state, id); const hasRead = participant.local || isChatOpen; - const timestampToDate = timestamp - ? new Date(timestamp) : new Date(); + const timestampToDate = timestamp ? new Date(timestamp) : new Date(); const millisecondsTimestamp = timestampToDate.getTime(); dispatch(addMessage({