From 25b84ba8b2b45f0ac2dd7da25bf2db7c0f382156 Mon Sep 17 00:00:00 2001 From: Mic Date: Fri, 23 Aug 2024 13:52:22 +0200 Subject: [PATCH] generateCallID method added --- js/mzta-utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 2e359c13..f3a34d3a 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -123,6 +123,16 @@ function compareThunderbirdVersions(v1, v2) { return 0; } +function generateCallID(length) { + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let result = ''; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +} + // The following methods are a modified version derived from https://github.com/ali-raheem/Aify/blob/13ff87583bc520fb80f555ab90a90c5c9df797a7/plugin/content_scripts/compose.js