From 5e00481639ddd2505f95db3722cd97e2c67ba385 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 24 May 2020 13:08:29 +0100 Subject: [PATCH] Fix sentMessageAndIsAlone by dispatching `message_sent` more consistently Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/emojipicker/ReactionPicker.js | 2 ++ src/components/views/messages/ReactionsRowButton.js | 2 ++ src/components/views/rooms/EditMessageComposer.js | 1 + src/components/views/rooms/SendMessageComposer.js | 1 + 4 files changed, 6 insertions(+) diff --git a/src/components/views/emojipicker/ReactionPicker.js b/src/components/views/emojipicker/ReactionPicker.js index 96894e18d2..6f8cc46c40 100644 --- a/src/components/views/emojipicker/ReactionPicker.js +++ b/src/components/views/emojipicker/ReactionPicker.js @@ -18,6 +18,7 @@ import React from 'react'; import PropTypes from "prop-types"; import EmojiPicker from "./EmojiPicker"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import dis from "../../../dispatcher/dispatcher"; class ReactionPicker extends React.Component { static propTypes = { @@ -105,6 +106,7 @@ class ReactionPicker extends React.Component { "key": reaction, }, }); + dis.dispatch({action: "message_sent"}); return true; } } diff --git a/src/components/views/messages/ReactionsRowButton.js b/src/components/views/messages/ReactionsRowButton.js index a7ff7dce96..09824cd315 100644 --- a/src/components/views/messages/ReactionsRowButton.js +++ b/src/components/views/messages/ReactionsRowButton.js @@ -22,6 +22,7 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { formatCommaSeparatedList } from '../../../utils/FormattingUtils'; +import dis from "../../../dispatcher/dispatcher"; export default class ReactionsRowButton extends React.PureComponent { static propTypes = { @@ -60,6 +61,7 @@ export default class ReactionsRowButton extends React.PureComponent { "key": content, }, }); + dis.dispatch({action: "message_sent"}); } }; diff --git a/src/components/views/rooms/EditMessageComposer.js b/src/components/views/rooms/EditMessageComposer.js index 88ed76f118..b70ef6255c 100644 --- a/src/components/views/rooms/EditMessageComposer.js +++ b/src/components/views/rooms/EditMessageComposer.js @@ -190,6 +190,7 @@ export default class EditMessageComposer extends React.Component { const roomId = editedEvent.getRoomId(); this._cancelPreviousPendingEdit(); this.context.sendMessage(roomId, editContent); + dis.dispatch({action: "message_sent"}); } // close the event editing and focus composer diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index 5ea979a8ef..b81e004943 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -312,6 +312,7 @@ export default class SendMessageComposer extends React.Component { event: null, }); } + dis.dispatch({action: "message_sent"}); } this.sendHistoryManager.save(this.model);