diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index b323901a..30e50a64 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -968,25 +968,28 @@ const ConvChatWindow = { //Add message options if(userIsPoster){ - //Update message content - var updateLi = createElem2({ - type: "li", - appendTo: dropdownMenu - }); - - var updateLink = createElem2({ - type: "a", - appendTo: updateLi, - innerHTML: "Edit" - }); - - updateLink.addEventListener("click", function(){ - ComunicWeb.components.conversations.messageEditor.open(message, function(newContent){ - /* - DEPRECATED WITH WEBSOCKETS - */ + if (message.file == null) + { + //Update message content + var updateLi = createElem2({ + type: "li", + appendTo: dropdownMenu }); - }); + + var updateLink = createElem2({ + type: "a", + appendTo: updateLi, + innerHTML: "Edit" + }); + + updateLink.addEventListener("click", function(){ + ComunicWeb.components.conversations.messageEditor.open(message, function(newContent){ + /* + DEPRECATED WITH WEBSOCKETS + */ + }); + }); + } diff --git a/assets/js/components/conversations/messageEditor.js b/assets/js/components/conversations/messageEditor.js index 3b729c0e..5a21d859 100644 --- a/assets/js/components/conversations/messageEditor.js +++ b/assets/js/components/conversations/messageEditor.js @@ -27,7 +27,7 @@ ComunicWeb.components.conversations.messageEditor = { //Intend to update message content ComunicWeb.components.conversations.interface.UpdateSingleMessage( - message.ID, + message.id, content, function(result){