checking for unreadMessages before sending confetti

throwing the confetti on the sender's side
change sendHtmlMessage to sendTextMessage in slashCommands
This commit is contained in:
nurjinn jafar 2020-08-26 18:56:23 +02:00
parent 5753c96431
commit 95051a42b1
3 changed files with 18 additions and 8 deletions

View file

@ -44,6 +44,8 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext";
import {MatrixClientPeg} from "../../../MatrixClientPeg";
import RateLimitedFunc from '../../../ratelimitedfunc';
import {Action} from "../../../dispatcher/actions";
import {isConfettiEmoji} from "../elements/Confetti";
import SettingsStore from "../../../settings/SettingsStore";
function addReplyToMessageContent(content, repliedToEvent, permalinkCreator) {
const replyContent = ReplyThread.makeReplyMixIn(repliedToEvent);
@ -313,6 +315,11 @@ export default class SendMessageComposer extends React.Component {
});
}
dis.dispatch({action: "message_sent"});
if (!SettingsStore.getValue('dontShowChatEffects')) {
if (isConfettiEmoji(content)) {
dis.dispatch({action: 'confetti'});
}
}
}
this.sendHistoryManager.save(this.model);