Get chat message display name from backend

This commit is contained in:
Bettenbuk Zoltan 2019-07-31 09:54:32 +02:00 committed by Zoltan Bettenbuk
parent b5489b7c81
commit e7144eb674
4 changed files with 9 additions and 6 deletions

4
package-lock.json generated
View File

@ -9073,8 +9073,8 @@
}
},
"lib-jitsi-meet": {
"version": "github:jitsi/lib-jitsi-meet#3c8058743177b6b6963d3bc3df14f4ea650ef310",
"from": "github:jitsi/lib-jitsi-meet#3c8058743177b6b6963d3bc3df14f4ea650ef310",
"version": "github:jitsi/lib-jitsi-meet#502ba82e1e4e4cdf8fe768566b6414f5c100491a",
"from": "github:jitsi/lib-jitsi-meet#502ba82e1e4e4cdf8fe768566b6414f5c100491a",
"requires": {
"@jitsi/sdp-interop": "0.1.14",
"@jitsi/sdp-simulcast": "0.2.1",

View File

@ -54,7 +54,7 @@
"js-utils": "github:jitsi/js-utils#192b1c996e8c05530eb1f19e82a31069c3021e31",
"jsrsasign": "8.0.12",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#3c8058743177b6b6963d3bc3df14f4ea650ef310",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#502ba82e1e4e4cdf8fe768566b6414f5c100491a",
"libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.11",
"moment": "2.19.4",

View File

@ -74,10 +74,13 @@ class ChatMessage extends AbstractChatMessage<Props> {
* @returns {React$Element<*>}
*/
_renderAvatar() {
const { message } = this.props;
return (
<View style = { styles.avatarWrapper }>
{ this.props.showAvatar && <Avatar
participantId = { this.props.message.id }
displayName = { message.displayName }
participantId = { message.id }
size = { styles.avatarWrapper.width } />
}
</View>

View File

@ -115,7 +115,7 @@ function _addChatMsgListener(conference, { dispatch, getState }) {
conference.on(
JitsiConferenceEvents.MESSAGE_RECEIVED,
(id, message, timestamp) => {
(id, message, timestamp, nick) => {
// Logic for all platforms:
const state = getState();
const { isOpen: isChatOpen } = state['features/chat'];
@ -127,7 +127,7 @@ function _addChatMsgListener(conference, { dispatch, getState }) {
// Provide a default for for the case when a message is being
// backfilled for a participant that has left the conference.
const participant = getParticipantById(state, id) || {};
const displayName = getParticipantDisplayName(getState, id);
const displayName = participant.name || nick || getParticipantDisplayName(state, id);
const hasRead = participant.local || isChatOpen;
const timestampToDate = timestamp
? new Date(timestamp) : new Date();