mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Propagate conversation message to chat window
This commit is contained in:
		@@ -202,6 +202,10 @@ class UserWebSocket {
 | 
				
			|||||||
				SendEvent("updatedConvMessage", msg.data);
 | 
									SendEvent("updatedConvMessage", msg.data);
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
 | 
								case "deleted_conv_message":
 | 
				
			||||||
 | 
									SendEvent("deletedConvMessage", msg.data.ID);
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			case "new_comment":
 | 
								case "new_comment":
 | 
				
			||||||
				SendEvent("new_comment", msg.data);
 | 
									SendEvent("new_comment", msg.data);
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1188,4 +1188,16 @@ document.addEventListener("updatedConvMessage", (e) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	target.replaceWith(ConvChatWindow._get_message_element(convInfo, msg).rootElem)
 | 
						target.replaceWith(ConvChatWindow._get_message_element(convInfo, msg).rootElem)
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Register to message deletion events
 | 
				
			||||||
 | 
					document.addEventListener("deletedConvMessage", (e) => {
 | 
				
			||||||
 | 
						const msgID = e.detail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Get message target
 | 
				
			||||||
 | 
						const target = document.querySelector("[data-chatwin-msg-id='"+msgID+"'] .direct-chat-text");
 | 
				
			||||||
 | 
						if(!target)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						target.style.display = "none";
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
		Reference in New Issue
	
	Block a user