attach message_sent and replies to file uploads

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-02-19 23:42:04 +00:00
parent 34b427d15e
commit 7048d85246
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E
3 changed files with 26 additions and 23 deletions

View file

@ -45,6 +45,7 @@ import { KeyCode, isOnlyCtrlOrCmdKeyEvent } from '../../Keyboard';
import RoomViewStore from '../../stores/RoomViewStore';
import RoomScrollStateStore from '../../stores/RoomScrollStateStore';
import SettingsStore from "../../settings/SettingsStore";
import Reply from "../views/elements/Reply";
const DEBUG = false;
let debuglog = function() {};
@ -895,11 +896,17 @@ module.exports = React.createClass({
return;
}
const baseContent = Reply.getMRelatesTo(RoomViewStore.getQuotingEvent());
ContentMessages.sendContentToRoom(
file, this.state.room.roomId, MatrixClientPeg.get(),
).done(undefined, (error) => {
file, this.state.room.roomId, MatrixClientPeg.get(), baseContent,
).done(() => {
dis.dispatch({
action: 'message_sent',
});
}, (error) => {
if (error.name === "UnknownDeviceError") {
// Let the staus bar handle this
// Let the status bar handle this
return;
}
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");