From ba0384f381441b8040dedcbe81669b2c8a1a3936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 14 Apr 2021 11:43:42 +0200 Subject: [PATCH 1/5] Render msgOption only if showReadReceipts is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/structures/_ScrollPanel.scss | 2 +- src/components/views/rooms/EventTile.js | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/res/css/structures/_ScrollPanel.scss b/res/css/structures/_ScrollPanel.scss index 699224949b..ebbaff0931 100644 --- a/res/css/structures/_ScrollPanel.scss +++ b/res/css/structures/_ScrollPanel.scss @@ -21,6 +21,6 @@ limitations under the License. display: flex; flex-direction: column; justify-content: flex-end; - overflow-y: hidden; + overflow: hidden; } } diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index a3474161d7..c48e557981 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -988,6 +988,16 @@ export default class EventTile extends React.Component { const groupPadlock = !useIRCLayout && !isBubbleMessage && this._renderE2EPadlock(); const ircPadlock = useIRCLayout && !isBubbleMessage && this._renderE2EPadlock(); + let msgOption; + if (SettingsStore.getValue("showReadReceipts")) { + msgOption = ( +
+ { readAvatars } +
+ ); + } + + switch (this.props.tileShape) { case 'notif': { const room = this.context.getRoom(this.props.mxEvent.getRoomId()); @@ -1107,9 +1117,7 @@ export default class EventTile extends React.Component { { reactionsRow } { actionBar } -
- { readAvatars } -
+ {msgOption} { // The avatar goes after the event tile as it's absolutely positioned to be over the // event tile line, so needs to be later in the DOM so it appears on top (this avoids From 43c236e8a59e4953f35543d0653200441dbcb95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 14 Apr 2021 12:24:33 +0200 Subject: [PATCH 2/5] Pass showReadReceipts from MessagePanel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/MessagePanel.js | 1 + src/components/views/rooms/EventTile.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 41a3015721..132d9ab4c3 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -659,6 +659,7 @@ export default class MessagePanel extends React.Component { showReactions={this.props.showReactions} layout={this.props.layout} enableFlair={this.props.enableFlair} + showReadReceipts={this.props.showReadReceipts} /> , diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index c48e557981..f9541ed4f8 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -260,6 +260,9 @@ export default class EventTile extends React.Component { // whether or not to show flair at all enableFlair: PropTypes.bool, + + // whether or not to show read receipts + showReadReceipts: PropTypes.bool, }; static defaultProps = { @@ -989,7 +992,7 @@ export default class EventTile extends React.Component { const ircPadlock = useIRCLayout && !isBubbleMessage && this._renderE2EPadlock(); let msgOption; - if (SettingsStore.getValue("showReadReceipts")) { + if (this.props.showReadReceipts) { msgOption = (
{ readAvatars } From a7b1c5dfe04cbd70b92d670d3de8172064fd055a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 14 Apr 2021 12:25:48 +0200 Subject: [PATCH 3/5] Run getReadAvatars() only when neccessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/EventTile.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index f9541ed4f8..2a18bfd794 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -861,8 +861,6 @@ export default class EventTile extends React.Component { permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId()); } - const readAvatars = this.getReadAvatars(); - let avatar; let sender; let avatarSize; @@ -993,6 +991,7 @@ export default class EventTile extends React.Component { let msgOption; if (this.props.showReadReceipts) { + const readAvatars = this.getReadAvatars(); msgOption = (
{ readAvatars } From 7fe5d2e9e471a7d283a392f0b22b6b2f07981e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 15 Apr 2021 17:49:35 +0200 Subject: [PATCH 4/5] Remove double blank line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/EventTile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 2a18bfd794..f6fb83c064 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -999,7 +999,6 @@ export default class EventTile extends React.Component { ); } - switch (this.props.tileShape) { case 'notif': { const room = this.context.getRoom(this.props.mxEvent.getRoomId()); From aad22903a7602bba65a9dc6284b01545f296b18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 15 Apr 2021 18:02:48 +0200 Subject: [PATCH 5/5] Remove overflow: hidden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This line doesn't seem to do anything * shrug Signed-off-by: Šimon Brandner --- res/css/structures/_ScrollPanel.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/res/css/structures/_ScrollPanel.scss b/res/css/structures/_ScrollPanel.scss index ebbaff0931..a4e501b339 100644 --- a/res/css/structures/_ScrollPanel.scss +++ b/res/css/structures/_ScrollPanel.scss @@ -21,6 +21,5 @@ limitations under the License. display: flex; flex-direction: column; justify-content: flex-end; - overflow: hidden; } }