From c4947260f73c587aea80ddb93c88fe25ac5f098f Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Mon, 16 Nov 2020 12:25:47 +0100 Subject: [PATCH] forwarding permissions: possibly prevent some unneccessary loops --- qml/js/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qml/js/functions.js b/qml/js/functions.js index a0954ac..4abc5c4 100644 --- a/qml/js/functions.js +++ b/qml/js/functions.js @@ -412,7 +412,7 @@ function getMessagesNeededForwardPermissions(messages) { var mediaMessageTypes = ["messageAudio", "messageDocument", "messagePhoto", "messageVideo", "messageVideoNote", "messageVoiceNote"]; var otherMessageTypes = ["messageAnimation", "messageGame", "messageSticker"] - for(var i = 0; i < messages.length; i += 1) { + for(var i = 0; i < messages.length && neededPermissions.length < 3; i += 1) { var type = messages[i]["content"]["@type"]; var permission = ""; if(type === "messageText") {