Commit eb221fb4cfcd450d2458461fa14d5079ee0a3bd7
If navigating to a blocked thread, show that there is a blocked message, but don't render it as a message
Anders Rune Jensen committed on 9/30/2017, 5:36:48 AMParent: f6a49ebd9fb233e15e04deecd49ddcbc3f6a4857
Files changed
feed/obs/thread.js | changed |
message/html/render/post.js | changed |
feed/obs/thread.js | ||
---|---|---|
@@ -27,9 +27,9 @@ | ||
27 | 27 | api.sbot.async.get(rootId, (err, value) => { |
28 | 28 | sync.set(true) |
29 | 29 | if (!err) { |
30 | 30 | var msg = unboxIfNeeded({key: rootId, value}) |
31 | - if (blocking().includes(msg.value.author)) return | |
31 | + if (blocking().includes(msg.value.author)) msg.isBlocked = true | |
32 | 32 | prepend.push(Value(msg)) |
33 | 33 | } |
34 | 34 | }) |
35 | 35 |
message/html/render/post.js | ||
---|---|---|
@@ -17,9 +17,9 @@ | ||
17 | 17 | return nest('message.html.render', function renderMessage (msg, opts) { |
18 | 18 | if (msg.value.content.type !== 'post') return |
19 | 19 | var element = api.message.html.layout(msg, extend({ |
20 | 20 | title: messageTitle(msg), |
21 | - content: messageContent(msg), | |
21 | + content: msg.isBlocked ? 'Content of a blocked user' : messageContent(msg), | |
22 | 22 | layout: 'default' |
23 | 23 | }, opts)) |
24 | 24 | |
25 | 25 | return api.message.html.decorate(element, { msg }) |
Built with git-ssb-web