From a0b814bf7c97fc29dd7c381ccae59ae46b861550 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Mon, 17 Dec 2018 14:20:26 +1100 Subject: [PATCH] limit max message length to 2000 characters. Set task time limit to 3 minutes. --- background.html | 2 +- js/views/conversation_view.js | 5 ++++- libtextsecure/task_with_timeout.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/background.html b/background.html index cc72737c9..0d4888b77 100644 --- a/background.html +++ b/background.html @@ -148,7 +148,7 @@
- +
diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 9855f9d36..03e487a16 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -1623,7 +1623,10 @@ } const input = this.$messageField; - const message = window.Signal.Emoji.replaceColons(input.val()).trim(); + const inputMessage = window.Signal.Emoji.replaceColons(input.val()).trim(); + + // Limit the message to 2000 characters + const message = inputMessage.substring(0, Math.min(2000, inputMessage.length)); try { if (!message.length && !this.fileInput.hasFiles()) { diff --git a/libtextsecure/task_with_timeout.js b/libtextsecure/task_with_timeout.js index 119d03f11..e0c96ef9e 100644 --- a/libtextsecure/task_with_timeout.js +++ b/libtextsecure/task_with_timeout.js @@ -7,7 +7,7 @@ window.textsecure = window.textsecure || {}; window.textsecure.createTaskWithTimeout = (task, id, options = {}) => { - const timeout = options.timeout || 1000 * 60 * 2; // two minutes + const timeout = options.timeout || 1000 * 60 * 3; // three minutes const errorForStack = new Error('for stack'); return () =>