git ssb

7+

dinoworm ๐Ÿ› / patchcore



Commit f5a00d5cf86de5f3363ef3c52de288cb24586390

Don't show posts of users you blocked

Anders Rune Jensen committed on 9/28/2017, 7:48:44 PM
Parent: bb1e475fdd46fa47fff6cd11fbcb7fa4c1157d43

Files changed

message/html/render/post.jschanged
message/html/render/post.jsView
@@ -2,8 +2,10 @@
22 var nest = require('depnest')
33 var extend = require('xtend')
44
55 exports.needs = nest({
6+ 'contact.obs.blockers': 'first',
7+ 'keys.sync.id': 'first',
68 'message.html': {
79 decorate: 'reduce',
810 layout: 'first',
911 link: 'first',
@@ -13,10 +15,16 @@
1315
1416 exports.gives = nest('message.html.render')
1517
1618 exports.create = function (api) {
19+ const myId = api.keys.sync.id()
20+
1721 return nest('message.html.render', function renderMessage (msg, opts) {
1822 if (msg.value.content.type !== 'post') return
23+
24+ const blockers = api.contact.obs.blockers(msg.value.author)
25+ if (blockers().includes(myId)) return
26+
1927 var element = api.message.html.layout(msg, extend({
2028 title: messageTitle(msg),
2129 content: messageContent(msg),
2230 layout: 'default'

Built with git-ssb-web