sharing button

This commit is contained in:
nnduc
2026-11-18 18:44:40 +07:00
parent 0d8107a0a7
commit a0499ade59
8 changed files with 227 additions and 2 deletions
+20
View File
@@ -70,6 +70,7 @@ var Chat = {
Chat.pagination = config['pagination'];
Chat.delivery_error = config['delivery_error'];
Chat.action_impossible_encrypted_error = config['action_impossible_encrypted_error'];
Chat.encrypted_file_error = config['encrypted_file_error'];
},
autocomplete: function (event, jid) {
RoomsUtils_ajaxMucUsersAutocomplete(jid);
@@ -292,6 +293,13 @@ var Chat = {
});
}
} else {
// The key of an encrypted file (a forwarded one) must not go in clear
if (typeof AESGCM_REGEX != 'undefined' && AESGCM_REGEX.test(text.trim())) {
Toast.send(Chat.encrypted_file_error);
Chat.disableSending();
return;
}
Chat.lastSentUUID = id = crypto.randomUUID();
let request = Chat_ajaxHttpDaemonSendMessage(id, jid, text, isMuc, null, replyMid, mucReceipts);
request.then(response => {
@@ -451,6 +459,18 @@ var Chat = {
Chat.toggleAction();
var textarea = Chat.getTextarea();
// A decrypted file forwarded to this discussion: through the upload
// panel, it is encrypted again if this discussion is encrypted
let forwarded = window.movimForwardFile;
if (forwarded && forwarded.jid == textarea.dataset.jid
&& typeof Upload != 'undefined' && Upload.file == null) {
delete window.movimForwardFile;
Upload.file = forwarded.file;
Upload.name = forwarded.file.name;
Upload_ajaxGetPanel();
}
textarea.onkeydown = function (event) {
if ((event.key == 'ArrowLeft' && Chat.tryPreviousEmoji())
|| (event.key == 'ArrowRight' && Chat.tryNextEmoji())) {