From f68036a4fb30c0bf067a08365ae86d5e0db1ccdd Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sun, 6 May 2018 19:18:41 +0100
Subject: [PATCH 1/2] Replies: un-break click-to-mention on SenderProfile for
reply&preview
Fixes #6670
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/EventTile.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js
index bfcf8ac9d4..b92504d0f1 100644
--- a/src/components/views/rooms/EventTile.js
+++ b/src/components/views/rooms/EventTile.js
@@ -556,11 +556,14 @@ module.exports = withMatrixClient(React.createClass({
if (needsSenderProfile) {
let text = null;
- if (!this.props.tileShape) {
+ if (!this.props.tileShape || this.props.tileShape === 'reply' || this.props.tileShape === 'reply_preview') {
if (msgtype === 'm.image') text = _td('%(senderName)s sent an image');
else if (msgtype === 'm.video') text = _td('%(senderName)s sent a video');
else if (msgtype === 'm.file') text = _td('%(senderName)s uploaded a file');
- sender = ;
+ sender = ;
} else {
sender = ;
}
From f0b7fd58b950ae8072862fe868225e6d36fbb0f0 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sun, 6 May 2018 19:28:18 +0100
Subject: [PATCH 2/2] delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/EventTile.js | 30 +++++++++++--------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js
index b92504d0f1..589524bb9e 100644
--- a/src/components/views/rooms/EventTile.js
+++ b/src/components/views/rooms/EventTile.js
@@ -202,17 +202,12 @@ module.exports = withMatrixClient(React.createClass({
return true;
}
- if (!this._propsEqual(this.props, nextProps)) {
- return true;
- }
-
- return false;
+ return !this._propsEqual(this.props, nextProps);
},
componentWillUnmount: function() {
const client = this.props.matrixClient;
- client.removeListener("deviceVerificationChanged",
- this.onDeviceVerificationChanged);
+ client.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged);
this.props.mxEvent.removeListener("Event.decrypted", this._onDecrypted);
},
@@ -227,7 +222,7 @@ module.exports = withMatrixClient(React.createClass({
},
onDeviceVerificationChanged: function(userId, device) {
- if (userId == this.props.mxEvent.getSender()) {
+ if (userId === this.props.mxEvent.getSender()) {
this._verifyEvent(this.props.mxEvent);
}
},
@@ -262,7 +257,7 @@ module.exports = withMatrixClient(React.createClass({
}
// need to deep-compare readReceipts
- if (key == 'readReceipts') {
+ if (key === 'readReceipts') {
const rA = objA[key];
const rB = objB[key];
if (rA === rB) {
@@ -336,7 +331,7 @@ module.exports = withMatrixClient(React.createClass({
getReadAvatars: function() {
// return early if there are no read receipts
if (!this.props.readReceipts || this.props.readReceipts.length === 0) {
- return ();
+ return ();
}
const ReadReceiptMarker = sdk.getComponent('rooms.ReadReceiptMarker');
@@ -360,7 +355,7 @@ module.exports = withMatrixClient(React.createClass({
left = (hidden ? MAX_READ_AVATARS - 1 : i) * -receiptOffset;
const userId = receipt.roomMember.userId;
- var readReceiptInfo;
+ let readReceiptInfo;
if (this.props.readReceiptMap) {
readReceiptInfo = this.props.readReceiptMap[userId];
@@ -502,17 +497,17 @@ module.exports = withMatrixClient(React.createClass({
mx_EventTile: true,
mx_EventTile_info: isInfoMessage,
mx_EventTile_12hr: this.props.isTwelveHour,
- mx_EventTile_encrypting: this.props.eventSendStatus == 'encrypting',
+ mx_EventTile_encrypting: this.props.eventSendStatus === 'encrypting',
mx_EventTile_sending: isSending,
- mx_EventTile_notSent: this.props.eventSendStatus == 'not_sent',
- mx_EventTile_highlight: this.props.tileShape == 'notif' ? false : this.shouldHighlight(),
+ mx_EventTile_notSent: this.props.eventSendStatus === 'not_sent',
+ mx_EventTile_highlight: this.props.tileShape === 'notif' ? false : this.shouldHighlight(),
mx_EventTile_selected: this.props.isSelectedEvent,
mx_EventTile_continuation: this.props.tileShape ? '' : this.props.continuation,
mx_EventTile_last: this.props.last,
mx_EventTile_contextual: this.props.contextual,
menu: this.state.menu,
- mx_EventTile_verified: this.state.verified == true,
- mx_EventTile_unverified: this.state.verified == false,
+ mx_EventTile_verified: this.state.verified === true,
+ mx_EventTile_unverified: this.state.verified === false,
mx_EventTile_bad: isEncryptionFailure,
mx_EventTile_emote: msgtype === 'm.emote',
mx_EventTile_redacted: isRedacted,
@@ -522,7 +517,8 @@ module.exports = withMatrixClient(React.createClass({
const readAvatars = this.getReadAvatars();
- let avatar, sender;
+ let avatar;
+ let sender;
let avatarSize;
let needsSenderProfile;