From fbb950e06433fd3aa4166b398ab3a2940538ebc2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 10 Feb 2018 12:38:25 +0000 Subject: [PATCH] mass s/Quote/Reply Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/elements/{Quote.js => Reply.js} | 18 +++++++++--------- src/components/views/messages/TextualBody.js | 1 - src/components/views/rooms/EventTile.js | 8 ++++---- .../views/rooms/MessageComposerInput.js | 8 ++++---- .../rooms/{QuotePreview.js => ReplyPreview.js} | 14 +++++++------- 5 files changed, 24 insertions(+), 25 deletions(-) rename src/components/views/elements/{Quote.js => Reply.js} (91%) rename src/components/views/rooms/{QuotePreview.js => ReplyPreview.js} (83%) diff --git a/src/components/views/elements/Quote.js b/src/components/views/elements/Reply.js similarity index 91% rename from src/components/views/elements/Quote.js rename to src/components/views/elements/Reply.js index 33819d522a..6d456cf6b4 100644 --- a/src/components/views/elements/Quote.js +++ b/src/components/views/elements/Reply.js @@ -23,7 +23,7 @@ import {MatrixEvent} from 'matrix-js-sdk'; import {makeUserPermalink} from "../../../matrix-to"; import SettingsStore from "../../../settings/SettingsStore"; -export default class Quote extends React.Component { +export default class Reply extends React.Component { static propTypes = { // The parent event parentEv: PropTypes.instanceOf(MatrixEvent), @@ -68,7 +68,7 @@ export default class Quote extends React.Component { async initialize() { const {parentEv} = this.props; - const inReplyTo = Quote.getInReplyTo(parentEv); + const inReplyTo = Reply.getInReplyTo(parentEv); const ev = await this.getEvent(this.room, inReplyTo['event_id']); this.setState({ @@ -79,7 +79,7 @@ export default class Quote extends React.Component { async loadNextEvent() { this.props.onWidgetLoad(); const ev = this.state.events[0]; - const inReplyTo = Quote.getInReplyTo(ev); + const inReplyTo = Reply.getInReplyTo(ev); if (!inReplyTo) { this.setState({ @@ -139,8 +139,8 @@ export default class Quote extends React.Component { } static getQuote(parentEv, onWidgetLoad) { - if (!SettingsStore.isFeatureEnabled("feature_rich_quoting") || !Quote.getInReplyTo(parentEv)) return null; - return ; + if (!SettingsStore.isFeatureEnabled("feature_rich_quoting") || !Reply.getInReplyTo(parentEv)) return null; + return ; } render() { @@ -149,10 +149,10 @@ export default class Quote extends React.Component { const ev = this.state.loadedEv; const Pill = sdk.getComponent('elements.Pill'); const room = MatrixClientPeg.get().getRoom(ev.getRoomId()); - header =
+ header =
{ _t('In reply to ', {}, { - 'a': (sub) => { sub }, + 'a': (sub) => { sub }, 'pill': , }) @@ -171,9 +171,9 @@ export default class Quote extends React.Component { dateSep = ; } - return
+ return
{ dateSep } - +
; }); diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 7da4dd8644..c91178d9b5 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -182,7 +182,6 @@ module.exports = React.createClass({ // If the link is a (localised) matrix.to link, replace it with a pill const Pill = sdk.getComponent('elements.Pill'); - const Quote = sdk.getComponent('elements.Quote'); if (Pill.isMessagePillUrl(href)) { const pillContainer = document.createElement('span'); diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 7e9a7a75f1..3b72525fbd 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -18,7 +18,7 @@ limitations under the License. 'use strict'; -import Quote from "../elements/Quote"; +import Reply from "../elements/Reply"; const React = require('react'); import PropTypes from 'prop-types'; @@ -589,12 +589,12 @@ module.exports = withMatrixClient(React.createClass({ ); } - case 'quote': { + case 'reply': { return (
{ avatar } { sender } -
+
{ timestamp } @@ -622,7 +622,7 @@ module.exports = withMatrixClient(React.createClass({ { timestamp } { this._renderE2EPadlock() } - { Quote.getQuote(this.props.mxEvent, this.props.onWidgetLoad) } + { Reply.getQuote(this.props.mxEvent, this.props.onWidgetLoad) }
- { SettingsStore.isFeatureEnabled("feature_rich_quoting") && } + { SettingsStore.isFeatureEnabled("feature_rich_quoting") && } this.autocomplete = e} room={this.props.room} diff --git a/src/components/views/rooms/QuotePreview.js b/src/components/views/rooms/ReplyPreview.js similarity index 83% rename from src/components/views/rooms/QuotePreview.js rename to src/components/views/rooms/ReplyPreview.js index 590ee21b8f..045c3da9b3 100644 --- a/src/components/views/rooms/QuotePreview.js +++ b/src/components/views/rooms/ReplyPreview.js @@ -27,7 +27,7 @@ function cancelQuoting() { }); } -export default class QuotePreview extends React.Component { +export default class ReplyPreview extends React.Component { constructor(props, context) { super(props, context); @@ -61,17 +61,17 @@ export default class QuotePreview extends React.Component { const EventTile = sdk.getComponent('rooms.EventTile'); const EmojiText = sdk.getComponent('views.elements.EmojiText'); - return
-
- + return
+
+ { '💬 ' + _t('Replying') } -
+
-
- +
+
; }