git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit 986ca1380e3f18f97a8d0a8b01c67079005ab91c

render following and blocking correctly

Dominic Tarr committed on 7/25/2016, 8:32:06 PM
Parent: 8ecc2b31db3e6fad1ecee253703e89b979f4ae62

Files changed

modules/follow.jschanged
modules/follow.jsView
@@ -5,14 +5,22 @@
55 var plugs = require('../plugs')
66
77 //render a message when someone follows someone,
88 //so you see new users
9+function isRelated(value, name) {
10+ return value ? name : value === false ? 'un'+name : ''
11+}
12+
913 exports.message_content = function (msg) {
1014
11- if(msg.value.content.type == 'contact' && msg.value.content.contact) {
12- return h('div.contact',
13- 'follows',
14- avatar(msg.value.content.contact, 'thumbnail')
15+ var content = msg.value.content
16+ if(content.type == 'contact' && content.contact) {
17+ var relation = content.following ? 'follows' : 'unfollows'
18+ return h('div.contact', [
19+ isRelated(content.following, 'follows'),
20+ isRelated(content.blocking, 'blocks')
21+ ].filter(Boolean).join(' and ')
22+ , avatar(msg.value.content.contact, 'thumbnail')
1523 )
1624 }
1725 }
1826
@@ -81,4 +89,18 @@
8189 }}, h('br'), label)
8290 )
8391 }
8492
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+

Built with git-ssb-web