Files: f1cc08ac986f18880000b780dae6fb2043e76948 / modules / about.js
993 bytesRaw
1 | var h = require('hyperscript') |
2 | var blobUrl = require('./helpers').bloburl |
3 | var markdown = require('./helpers').markdown |
4 | |
5 | var config = require('../config')() |
6 | |
7 | exports.gives = { |
8 | message_content_mini: true |
9 | } |
10 | |
11 | exports.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