sync shitcode xD

This commit is contained in:
doesnm 2024-04-16 22:19:14 +03:00
parent 2e5e0b4b26
commit 9c677c6fd2
2 changed files with 11 additions and 1 deletions

View file

@ -22,9 +22,12 @@ function getReactions(posts,p){
});
}
function printPost(post,roomId,noButton){
if(post.type != "m.room.message") return false;
//console.log(post)
let body = DOMPurify.sanitize(post.content.formatted_body ?? post.content.body);
body = body.split("\n").join("<br>");
table.innerHTML += `<tr><td><b>${post.sender}</b><br>${body}${post.content.msgtype == "m.image" ? `<br><img src="https://matrix.org/_matrix/media/v3/download/${post.content.url.slice(6)}">` : ''}${!noButton ? `<br><a href="#${roomId}/${post.event_id}">Открыть</a>` : ''}</td></tr>`;
table.innerHTML += `<tr><td><b>${post.sender}</b><br>${body}${post.content.msgtype == "m.image" ? `<br><img src="https://matrix.org/_matrix/media/v3/download/${post.content.url.slice(6)}">` : ''}${getReactions(posts,post)}${!noButton ? `<br><a href="#${roomId}/${post.event_id}">Открыть</a>` : ''}</td></tr>`;
}
function loadPosts(roomId,start){