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 @@
+