diff --git a/src/conversejs/converse.js b/src/conversejs/converse.js index 027a314296898e99686e1ebbfcbb003c2278e767..2b95ef73f765c8ffdfc0b033341261fa31e58ab2 100644 --- a/src/conversejs/converse.js +++ b/src/conversejs/converse.js @@ -78269,7 +78269,8 @@ const MessageMixin = { if (slot) { this.save({ 'get': slot.querySelector('get').getAttribute('url'), - 'put': slot.querySelector('put').getAttribute('url') + 'put': slot.querySelector('put').getAttribute('url'), + 'headers': slot.querySelector('put').querySelectorAll('header') }); } else { return this.save({ @@ -78327,6 +78328,12 @@ const MessageMixin = { xhr.open('PUT', this.get('put'), true); xhr.setRequestHeader('Content-type', this.file.type); + + // Add custom headers to request + this.get('headers')?.forEach(header => { + xhr.setRequestHeader(header.getAttribute('name'), header.innerHTML); + }); + xhr.send(this.file); } @@ -89704,7 +89711,7 @@ var form_username_default = /*#__PURE__*/__webpack_require__.n(form_username); // CONCATENATED MODULE: ./src/templates/directives/image.js function image_templateObject() { - const data = image_taggedTemplateLiteral(["<a href=\"", "\"\n class=\"chat-image__link\"\n target=\"_blank\"\n rel=\"noopener\"\n ><img class=\"chat-image img-thumbnail\" src=\"", "\" @click=", " @error=", " @load=", "/></a>"]); + const data = image_taggedTemplateLiteral(["<img class=\"chat-image img-thumbnail\" src=\"", "\" @click=", " @error=", " @load=", "/>"]); image_templateObject = function () { return data; @@ -89743,7 +89750,7 @@ const renderImage = directive_directive((src, href, onLoad, onClick) => part => } } - part.setValue(lit_html_html(image_templateObject(), href, src, onClick, onError, onLoad)); + part.setValue(lit_html_html(image_templateObject(), src, onClick, onError, onLoad)); }); // CONCATENATED MODULE: ./src/templates/image.js function templates_image_templateObject() { @@ -89883,7 +89890,7 @@ utils_core.isAudioURL = url => checkFileTypes(['.ogg', '.mp3', '.m4a'], url); utils_core.isVideoURL = url => checkFileTypes(['.mp4', '.webm'], url); -utils_core.isURLWithImageExtension = url => checkFileTypes(['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.svg'], url); +utils_core.isURLWithImageExtension = url => checkFileTypes(['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.svg', '.webp'], url); utils_core.isImageURL = url => { const regex = core_api.settings.get('image_urls_regex'); @@ -92224,7 +92231,7 @@ class body_MessageBodyRenderer { async transform() { const show_images = core_api.settings.get('show_images_inline'); const offset = 0; - const text = new text_MessageText(this.text, this.model, offset, show_images, () => this.scrollDownOnImageLoad(), ev => this.component.showImageModal(ev)); + const text = new text_MessageText(this.text, this.model, offset, show_images, () => this.scrollDownOnImageLoad(), () => {}); await text.addTemplates(); return text.payload; } diff --git a/src/solid-xmpp-chat.js b/src/solid-xmpp-chat.js index ad96789905677fb3963d9f269221cb5ec6709e93..5e14d12f9fae4b54b266c159856c475e980d9556 100644 --- a/src/solid-xmpp-chat.js +++ b/src/solid-xmpp-chat.js @@ -384,6 +384,7 @@ export const SolidXMPPChat = { 'assets_path': (/skypack/.test(ComponentPath) ? ComponentPath.replace('cdn.skypack.dev', 'unpkg.com') : ComponentPath) + '/dist/conversejs/', 'authentication': this.element.dataset.authentication || 'login', 'password': idToken, + 'allow_bookmarks': false, 'allow_chat_pending_contacts': true, 'allow_message_retraction': 'moderator', 'allow_non_roster_messaging': true, @@ -422,7 +423,7 @@ export const SolidXMPPChat = { call: false, spoiler: false, emoji: true, - fileupload: false, // Not working in current Converse + fileupload: true, // Not working in current Converse toggle_occupants: false }, 'whitelisted_plugins': ['rai', 'conversejs-sib-disconnected', 'conversejs-sib-connected', 'conversejs-sib-focused', 'conversejs-changechat', 'conversejs-rai', 'custom-hats', 'remove-notifications'], diff --git a/src/styles/index.scss b/src/styles/index.scss index 1eec9034e1f723c73210ee51eb9649e0503192a2..19aed3d84b78cc018cfbe58c71262d7a5bb7a247 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -153,14 +153,6 @@ font-size: 12px; } - - /* Hide send file button */ - button[title="Choose a file to send"] { - display: none; - border: none; - background: none; - } - /* To hide the trash icon because you can't remove a message for now */ >.converse-chatboxes .chat-body .chat-msg__actions>button.chat-msg__action.fa-trash-alt { display: none;