From 9c677c6fd2801a61d8ac8221bf00ec10ee740e79 Mon Sep 17 00:00:00 2001 From: doesnm Date: Tue, 16 Apr 2024 22:19:14 +0300 Subject: [PATCH] sync shitcode xD --- blog.js | 5 ++++- index.html | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/blog.js b/blog.js index aaaee6f..c2b452f 100644 --- a/blog.js +++ b/blog.js @@ -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("
"); - table.innerHTML += `${post.sender}
${body}${post.content.msgtype == "m.image" ? `
` : ''}${!noButton ? `
Открыть` : ''}`; + table.innerHTML += `${post.sender}
${body}${post.content.msgtype == "m.image" ? `
` : ''}${getReactions(posts,post)}${!noButton ? `
Открыть` : ''}`; } function loadPosts(roomId,start){ diff --git a/index.html b/index.html index 50e792d..2f47d5c 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,12 @@
+