From 5c6276d11ac101696ab9056f1b49b825434b1112 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 6 Mar 2021 15:06:54 +0100 Subject: [PATCH] Can send file from chat box --- assets/js/components/conversations/chatWindows.js | 7 ++++--- assets/js/components/conversations/manager.js | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index bfd4e4fb..88c7cbd1 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -159,6 +159,7 @@ const ConvChatWindow = { type: "input", elemType: "file", }); + fileInput.accept = ServerConfig.conf.allowed_conversation_files_type.join(", "); //Create button group @@ -216,7 +217,7 @@ const ConvChatWindow = { createElem2({ type: "i", appendTo: fileButton, - class: "fa fa-image" + class: "fa fa-plus" }); //Add send button @@ -234,8 +235,8 @@ const ConvChatWindow = { class: "fa fa-send-o", }); - console.info(infosBox) - //ConversationsUtils.registerInputToSendFile(, fileInput, formContainer); + + ConversationsUtils.registerInputToSendFile(infosBox.conversationID, fileInput, conversationFormContainer); // =========== /SEND FILES =========== diff --git a/assets/js/components/conversations/manager.js b/assets/js/components/conversations/manager.js index 5e0bdf33..5576278e 100644 --- a/assets/js/components/conversations/manager.js +++ b/assets/js/components/conversations/manager.js @@ -138,9 +138,7 @@ ComunicWeb.components.conversations.manager = { } //Open the first conversation - ComunicWeb.components.conversations.manager.addConversation({ - conversationID: result.conversationsID[0], - }); + ComunicWeb.components.conversations.manager.addConversation(result.conversationsID[0]); };