Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(chat/native) private message replies (#11521)

Calinteodor0fe738315485
diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.js
index 20d7008523..ef7d71a07a 100644
--- a/react/features/chat/components/native/Chat.js
+++ b/react/features/chat/components/native/Chat.js
@@ -6,7 +6,6 @@ import React, { useEffect } from 'react';
import { translate } from '../../../base/i18n';
import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { connect } from '../../../base/redux';
-import { closeChat, openChat } from '../../actions.native';
import AbstractChat, {
_mapStateToProps,
type Props as AbstractProps
@@ -69,26 +68,19 @@ class Chat extends AbstractChat<Props> {
export default translate(connect(_mapStateToProps)(props => {
const {
_nbUnreadMessages,
- dispatch,
navigation,
- route,
t
} = props;
const isChatScreenFocused = useIsFocused();
- const privateMessageRecipient = route.params?.privateMessageRecipient;
const nrUnreadMessages
= !isChatScreenFocused && _nbUnreadMessages > 0
? `(${_nbUnreadMessages})` : '';
useEffect(() => {
- dispatch(openChat(privateMessageRecipient));
-
navigation.setOptions({
tabBarLabel: `${t('chat.tabs.chat')} ${nrUnreadMessages}`
});
-
- return () => dispatch(closeChat());
}, [ nrUnreadMessages ]);
return (
diff --git a/react/features/chat/components/native/PrivateMessageButton.js b/react/features/chat/components/native/PrivateMessageButton.js
index 044a87c3a9..b639fbf26a 100644
--- a/react/features/chat/components/native/PrivateMessageButton.js
+++ b/react/features/chat/components/native/PrivateMessageButton.js
@@ -58,7 +58,7 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
toggledIcon = IconReply;
/**
- * Handles clicking / pressing the button, and kicks the participant.
+ * Handles clicking / pressing the button.
*
* @private
* @returns {void}
@@ -67,6 +67,7 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
if (this.props._isLobbyMessage) {
this.props.dispatch(handleLobbyChatInitialized(this.props.participantID));
}
+
this.props._isPollsDisabled
? navigate(screen.conference.chat, {
privateMessageRecipient: this.props._participant
@@ -102,11 +103,11 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
export function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
const { disablePolls } = state['features/base/config'];
- const { visible = enabled, isLobbyMessage } = ownProps;
+ const { visible = enabled, isLobbyMessage, participantID } = ownProps;
return {
_isPollsDisabled: disablePolls,
- _participant: getParticipantById(state, ownProps.participantID),
+ _participant: getParticipantById(state, participantID),
_isLobbyMessage: isLobbyMessage,
visible
};