restrict to m.text for now
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
90f9badbf3
commit
665ddccb0d
4 changed files with 9 additions and 11 deletions
|
@ -275,13 +275,13 @@ class ContentMessages {
|
||||||
this.nextId = 0;
|
this.nextId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendContentToRoom(file, roomId, matrixClient, baseContent) {
|
sendContentToRoom(file, roomId, matrixClient) {
|
||||||
const content = Object.assign({}, baseContent, {
|
const content = {
|
||||||
body: file.name || 'Attachment',
|
body: file.name || 'Attachment',
|
||||||
info: {
|
info: {
|
||||||
size: file.size,
|
size: file.size,
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
|
||||||
// if we have a mime type for the file, add it to the message metadata
|
// if we have a mime type for the file, add it to the message metadata
|
||||||
if (file.type) {
|
if (file.type) {
|
||||||
|
|
|
@ -896,10 +896,8 @@ module.exports = React.createClass({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseContent = Reply.getMRelatesTo(RoomViewStore.getQuotingEvent());
|
|
||||||
|
|
||||||
ContentMessages.sendContentToRoom(
|
ContentMessages.sendContentToRoom(
|
||||||
file, this.state.room.roomId, MatrixClientPeg.get(), baseContent,
|
file, this.state.room.roomId, MatrixClientPeg.get(),
|
||||||
).done(() => {
|
).done(() => {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'message_sent',
|
action: 'message_sent',
|
||||||
|
|
|
@ -853,6 +853,11 @@ export default class MessageComposerInput extends React.Component {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'message_sent',
|
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));
|
}, (e) => onSendMessageFailed(e, this.props.room));
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -116,11 +116,6 @@ class RoomViewStore extends Store {
|
||||||
replyingToEvent: payload.event,
|
replyingToEvent: payload.event,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'message_sent':
|
|
||||||
this._setState({
|
|
||||||
replyingToEvent: null,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue