forwarding permissions: possibly prevent some unneccessary loops

This commit is contained in:
John Gibbon 2020-11-16 12:25:47 +01:00
parent ac10e600bf
commit c4947260f7

View file

@ -412,7 +412,7 @@ function getMessagesNeededForwardPermissions(messages) {
var mediaMessageTypes = ["messageAudio", "messageDocument", "messagePhoto", "messageVideo", "messageVideoNote", "messageVoiceNote"]; var mediaMessageTypes = ["messageAudio", "messageDocument", "messagePhoto", "messageVideo", "messageVideoNote", "messageVoiceNote"];
var otherMessageTypes = ["messageAnimation", "messageGame", "messageSticker"] 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 type = messages[i]["content"]["@type"];
var permission = ""; var permission = "";
if(type === "messageText") { if(type === "messageText") {