Can request message content update

This commit is contained in:
Pierre HUBERT 2021-03-06 14:52:35 +01:00
parent ba2c21bf54
commit 417b8a6600
2 changed files with 22 additions and 19 deletions

View File

@ -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
*/
});
});
}

View File

@ -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){