plugs/message/html/render/following.jsView |
---|
18 | 18 | const i18n = api.intl.sync.i18n |
19 | 19 | return nest('message.html.render', function renderMessage (msg, opts) { |
20 | 20 | if (msg.value.content.type !== 'contact') return |
21 | 21 | if (!ref.isFeed(msg.value.content.contact)) return |
22 | | - if (typeof msg.value.content.following !== 'boolean') return |
| 22 | + if (typeof msg.value.content.following !== 'boolean' && typeof msg.value.content.blocking !== 'boolean') return |
23 | 23 | |
24 | 24 | var element = api.message.html.layout(msg, extend({ |
25 | 25 | miniContent: messageContent(msg), |
26 | 26 | layout: 'mini' |
30 | 30 | }) |
31 | 31 | |
32 | 32 | function messageContent (msg) { |
33 | 33 | var following = msg.value.content.following |
34 | | - return [ |
35 | | - following ? i18n('followed ') : i18n('unfollowed '), |
36 | | - api.profile.html.person(msg.value.content.contact) |
37 | | - ] |
| 34 | + var blocking = msg.value.content.blocking |
| 35 | + |
| 36 | + if (typeof blocking === 'boolean') { |
| 37 | + return [ |
| 38 | + blocking ? i18n('blocked ') : i18n('unblocked '), |
| 39 | + api.profile.html.person(msg.value.content.contact) |
| 40 | + ] |
| 41 | + } else { |
| 42 | + return [ |
| 43 | + following ? i18n('followed ') : i18n('unfollowed '), |
| 44 | + api.profile.html.person(msg.value.content.contact) |
| 45 | + ] |
| 46 | + } |
38 | 47 | } |
39 | 48 | } |