Use doMaybeLocalRoomAction (#9038)
* Use doMaybeLocalRoomAction * Revert unnecessary changes
This commit is contained in:
parent
9b8b8763f7
commit
3be20cf434
12 changed files with 333 additions and 22 deletions
|
@ -58,6 +58,7 @@ import { getSlashCommand, isSlashCommand, runSlashCommand, shouldSendAnyway } fr
|
|||
import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
|
||||
import { PosthogAnalytics } from "../../../PosthogAnalytics";
|
||||
import { addReplyToMessageContent } from '../../../utils/Reply';
|
||||
import { doMaybeLocalRoomAction } from '../../../utils/local-room';
|
||||
|
||||
// Merges favouring the given relation
|
||||
export function attachRelation(content: IContent, relation?: IEventRelation): void {
|
||||
|
@ -401,7 +402,11 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
|
|||
? this.props.relation.event_id
|
||||
: null;
|
||||
|
||||
const prom = this.props.mxClient.sendMessage(roomId, threadId, content);
|
||||
const prom = doMaybeLocalRoomAction(
|
||||
roomId,
|
||||
(actualRoomId: string) => this.props.mxClient.sendMessage(actualRoomId, threadId, content),
|
||||
this.props.mxClient,
|
||||
);
|
||||
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