git ssb

0+

ev / minbase



Tree: f1cc08ac986f18880000b780dae6fb2043e76948

Files: f1cc08ac986f18880000b780dae6fb2043e76948 / modules / about.js

993 bytesRaw
1var h = require('hyperscript')
2var blobUrl = require('./helpers').bloburl
3var markdown = require('./helpers').markdown
4
5var config = require('../config')()
6
7exports.gives = {
8 message_content_mini: true
9}
10
11exports.create = function (api) {
12 exports.message_content_mini = function (msg) {
13 var about = msg.value.content
14 var id = msg.value.content.about
15 if (msg.value.content.type == 'description') {
16 return h('span', markdown('**Description:** ' + about.description))
17 }
18 if (msg.value.content.type == 'loc') {
19 return h('span', h('strong', 'Location: '), about.loc)
20 }
21 if (msg.value.content.type == 'about') {
22 if (msg.value.content.name) {
23 return h('span', 'identifies as ', about.name)
24 }
25 if (msg.value.content.image) {
26 console.log(msg.value.content.image)
27 return h('span.avatar--tiny', 'identifies as ', h('img', {src: config.blobsUrl + about.image.link}))
28 }
29 } else { return }
30 }
31 return exports
32}
33

Built with git-ssb-web