slash-commands: Suppress local echo for slash commands.

This commit is contained in:
Joshua Pan
2018-05-16 16:05:11 -04:00
committed by Tim Abbott
parent afe09071b9
commit a62e10d9c2

View File

@@ -93,6 +93,11 @@ function insert_local_message(message_request, local_id) {
return message.local_id;
}
exports.is_slash_command = function (content) {
return !content.startsWith('/me') && content.startsWith('/');
};
exports.try_deliver_locally = function try_deliver_locally(message_request) {
if (markdown.contains_backend_only_syntax(message_request.content)) {
return;
@@ -102,6 +107,10 @@ exports.try_deliver_locally = function try_deliver_locally(message_request) {
return;
}
if (exports.is_slash_command(message_request.content)) {
return;
}
var next_local_id = local_message.get_next_id();
if (!next_local_id) {