diff --git a/app/screens/user_profile/index.js b/app/screens/user_profile/index.js index d6bde6368..4738327d8 100644 --- a/app/screens/user_profile/index.js +++ b/app/screens/user_profile/index.js @@ -7,9 +7,7 @@ import {connect} from 'react-redux'; import {setChannelDisplayName} from 'app/actions/views/channel'; import {makeDirectChannel} from 'app/actions/views/more_dms'; -import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import UserProfile from './user_profile'; @@ -21,9 +19,7 @@ function mapStateToProps(state, ownProps) { return { config, createChannelRequest, - currentChannel: getCurrentChannel(state) || {}, currentDisplayName: state.views.channel.displayName, - currentUserId: getCurrentUserId(state), user: state.entities.users.profiles[ownProps.userId], teammateNameDisplay: getTeammateNameDisplaySetting(state), theme: getTheme(state), diff --git a/app/screens/user_profile/user_profile.js b/app/screens/user_profile/user_profile.js index 88407cca2..c141e4c34 100644 --- a/app/screens/user_profile/user_profile.js +++ b/app/screens/user_profile/user_profile.js @@ -11,7 +11,6 @@ import { } from 'react-native'; import {intlShape} from 'react-intl'; -import {getDirectChannelName} from 'mattermost-redux/utils/channel_utils'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; import ProfilePicture from 'app/components/profile_picture'; @@ -29,9 +28,7 @@ export default class UserProfile extends PureComponent { setChannelDisplayName: PropTypes.func.isRequired, }).isRequired, config: PropTypes.object.isRequired, - currentChannel: PropTypes.object.isRequired, currentDisplayName: PropTypes.string, - currentUserId: PropTypes.string.isRequired, navigator: PropTypes.object, teammateNameDisplay: PropTypes.string, theme: PropTypes.object.isRequired, @@ -65,12 +62,6 @@ export default class UserProfile extends PureComponent { }); }; - displaySendMessageOption = () => { - const {currentChannel, currentUserId, user} = this.props; - - return currentChannel.name !== getDirectChannelName(currentUserId, user.id); - }; - getDisplayName = () => { const {theme, teammateNameDisplay, user} = this.props; const style = createStyleSheet(theme); @@ -199,7 +190,6 @@ export default class UserProfile extends PureComponent { {config.ShowEmailAddress === 'true' && this.buildDisplayBlock('email')} {this.buildDisplayBlock('position')} - {this.displaySendMessageOption() && - } {this.renderAdditionalOptions()}