From a580d3a8672a9366293f2378ab8dc6bc0e23ef77 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 17 Feb 2020 13:06:46 -0300 Subject: [PATCH] [FIX] Add missing calls to user info (#1741) --- app/containers/message/MessageAvatar.js | 2 +- app/containers/message/index.js | 13 +++++++++++++ app/views/MessagesView/index.js | 11 ++++++++++- app/views/SearchMessagesView/index.js | 9 +++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/containers/message/MessageAvatar.js b/app/containers/message/MessageAvatar.js index 1c15ae757..190bb43a8 100644 --- a/app/containers/message/MessageAvatar.js +++ b/app/containers/message/MessageAvatar.js @@ -8,7 +8,7 @@ import styles from './styles'; const MessageAvatar = React.memo(({ isHeader, avatar, author, baseUrl, user, small, navToRoomInfo }) => { - if (isHeader) { + if (isHeader && author) { const navParam = { t: 'd', rid: author._id diff --git a/app/containers/message/index.js b/app/containers/message/index.js index 322c334e7..c114e8c4e 100644 --- a/app/containers/message/index.js +++ b/app/containers/message/index.js @@ -50,7 +50,20 @@ class MessageContainer extends React.Component { } static defaultProps = { + getCustomEmoji: () => {}, onLongPress: () => {}, + onReactionPress: () => {}, + onDiscussionPress: () => {}, + onThreadPress: () => {}, + errorActionsShow: () => {}, + replyBroadcast: () => {}, + reactionInit: () => {}, + fetchThreadName: () => {}, + showAttachment: () => {}, + onReactionLongPress: () => {}, + navToRoomInfo: () => {}, + callJitsi: () => {}, + blockAction: () => {}, archived: false, broadcast: false, theme: 'light' diff --git a/app/views/MessagesView/index.js b/app/views/MessagesView/index.js index 49aeb8713..cd724adaf 100644 --- a/app/views/MessagesView/index.js +++ b/app/views/MessagesView/index.js @@ -74,6 +74,14 @@ class MessagesView extends React.Component { return false; } + navToRoomInfo = (navParam) => { + const { navigation, user } = this.props; + if (navParam.rid === user.id) { + return; + } + navigation.navigate('RoomInfoView', navParam); + } + defineMessagesViewContent = (name) => { const { messages } = this.state; const { user, baseUrl, theme } = this.props; @@ -88,7 +96,8 @@ class MessagesView extends React.Component { isHeader: true, attachments: item.attachments || [], showAttachment: this.showAttachment, - getCustomEmoji: this.getCustomEmoji + getCustomEmoji: this.getCustomEmoji, + navToRoomInfo: this.navToRoomInfo }); return ({ diff --git a/app/views/SearchMessagesView/index.js b/app/views/SearchMessagesView/index.js index c7c102ff5..8c8457816 100644 --- a/app/views/SearchMessagesView/index.js +++ b/app/views/SearchMessagesView/index.js @@ -94,6 +94,14 @@ class SearchMessagesView extends React.Component { return null; } + navToRoomInfo = (navParam) => { + const { navigation, user } = this.props; + if (navParam.rid === user.id) { + return; + } + navigation.navigate('RoomInfoView', navParam); + } + renderEmpty = () => { const { theme } = this.props; return ( @@ -118,6 +126,7 @@ class SearchMessagesView extends React.Component { isHeader showAttachment={() => {}} getCustomEmoji={this.getCustomEmoji} + navToRoomInfo={this.navToRoomInfo} theme={theme} /> );