Make local echo work for threads (#7157)
This commit is contained in:
parent
7f350ae0f4
commit
392c4ad8d9
4 changed files with 17 additions and 5 deletions
|
@ -81,7 +81,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
|||
this.teardownThread();
|
||||
dis.unregister(this.dispatcherRef);
|
||||
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
||||
room.on(ThreadEvent.New, this.onNewThread);
|
||||
room.removeListener(ThreadEvent.New, this.onNewThread);
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps) {
|
||||
|
|
|
@ -426,7 +426,11 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
|
|||
}
|
||||
if (shouldSend) {
|
||||
this.cancelPreviousPendingEdit();
|
||||
const prom = this.props.mxClient.sendMessage(roomId, editContent);
|
||||
|
||||
const event = this.props.editState.getEvent();
|
||||
const threadId = event.threadRootId || null;
|
||||
|
||||
const prom = this.props.mxClient.sendMessage(roomId, threadId, editContent);
|
||||
this.clearStoredEditorState();
|
||||
dis.dispatch({ action: "message_sent" });
|
||||
CountlyAnalytics.instance.trackSendMessage(startTime, prom, roomId, true, false, editContent);
|
||||
|
|
|
@ -483,7 +483,11 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
|
|||
decorateStartSendingTime(content);
|
||||
}
|
||||
|
||||
const prom = this.props.mxClient.sendMessage(roomId, content);
|
||||
const threadId = this.props.relation?.rel_type === RelationType.Thread
|
||||
? this.props.relation.event_id
|
||||
: null;
|
||||
|
||||
const prom = this.props.mxClient.sendMessage(roomId, threadId, content);
|
||||
if (replyToEvent) {
|
||||
// Clear reply_to_event as we put the message into the queue
|
||||
// if the send fails, retry will handle resending.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue