From 665ddccb0d9058d3c55f72e4a26ede8e44f7b4c8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 20 Feb 2018 15:45:25 +0000 Subject: [PATCH] restrict to m.text for now Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/ContentMessages.js | 6 +++--- src/components/structures/RoomView.js | 4 +--- src/components/views/rooms/MessageComposerInput.js | 5 +++++ src/stores/RoomViewStore.js | 5 ----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ContentMessages.js b/src/ContentMessages.js index f0e8736aba..8d40b65124 100644 --- a/src/ContentMessages.js +++ b/src/ContentMessages.js @@ -275,13 +275,13 @@ class ContentMessages { this.nextId = 0; } - sendContentToRoom(file, roomId, matrixClient, baseContent) { - const content = Object.assign({}, baseContent, { + sendContentToRoom(file, roomId, matrixClient) { + const content = { body: file.name || 'Attachment', info: { size: file.size, }, - }); + }; // if we have a mime type for the file, add it to the message metadata if (file.type) { diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index ae9522e511..75fa316030 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -896,10 +896,8 @@ module.exports = React.createClass({ return; } - const baseContent = Reply.getMRelatesTo(RoomViewStore.getQuotingEvent()); - ContentMessages.sendContentToRoom( - file, this.state.room.roomId, MatrixClientPeg.get(), baseContent, + file, this.state.room.roomId, MatrixClientPeg.get(), ).done(() => { dis.dispatch({ action: 'message_sent', diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index e8725bdf05..c2fcfd9688 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -853,6 +853,11 @@ export default class MessageComposerInput extends React.Component { dis.dispatch({ action: 'message_sent', }); + // Once replies are not only for text, we can use message_sent for this + dis.dispatch({ + action: 'reply_to_event', + event: null, + }); }, (e) => onSendMessageFailed(e, this.props.room)); this.setState({ diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js index 2c81f9de23..1e7e50eae0 100644 --- a/src/stores/RoomViewStore.js +++ b/src/stores/RoomViewStore.js @@ -116,11 +116,6 @@ class RoomViewStore extends Store { replyingToEvent: payload.event, }); break; - case 'message_sent': - this._setState({ - replyingToEvent: null, - }); - break; } }