Commit da746f37c4647de40e6fd6a9f2ae5efdbb60ef4d
add repost
Ev Bogue committed on 9/15/2016, 9:20:04 PMParent: ebd41b26e5d433b1e3663e427faed20e23e6615d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -5,8 +5,9 @@ | ||
5 | 5 … | var client = require('ssb-client') |
6 | 6 … | var md = require('ssb-markdown') |
7 | 7 … | var avatar = require('ssb-avatar') |
8 | 8 … | var mo = require('moment') |
9 … | +var ref = require('ssb-ref') | |
9 | 10 … | |
10 | 11 … | var title = 'sdash' |
11 | 12 … | var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519' |
12 | 13 … | var desc = 'This is <a href="https://gitmx.com/%25qrU04j9vfUJKfq1rGZrQ5ihtSfA4ilfY3wLy7xFv0xk%3D.sha256">sdash</a>, a work-in-progress personal gateway to the <a href="http://ssbc.github.io">scuttlebot</a> distributed social network' |
@@ -36,9 +37,8 @@ | ||
36 | 37 … | pull( |
37 | 38 … | sbot.query.read({query: [{$filter: { key: getpin.value.content.link}}]}), |
38 | 39 … | pull.drain(function (data) { |
39 | 40 … | pinned = data; |
40 | - gotPost() | |
41 | 41 … | }) |
42 | 42 … | ) |
43 | 43 … | }) |
44 | 44 … | ) |
@@ -47,16 +47,17 @@ | ||
47 | 47 … | pull.drain(function (data) { |
48 | 48 … | vote = data; |
49 | 49 … | pull( |
50 | 50 … | sbot.query.read({query: [{$filter: { key: data.value.content.vote.link}}]}), |
51 | - pull.drain(function (reblog) { | |
52 | - avatar(sbot, me, reblog.value.author, function (err, avatar){ | |
51 … | + pull.drain(function (data) { | |
52 … | + avatar(sbot, me, data.value.author, function (err, avatar){ | |
53 | 53 … | if (err) { |
54 | 54 … | throw err; |
55 | 55 … | } |
56 | 56 … | reauthor = avatar; |
57 … | + gotPost() | |
57 | 58 … | }) |
58 | - redo = reblog; | |
59 … | + redo = data; | |
59 | 60 … | }) |
60 | 61 … | ) |
61 | 62 … | }) |
62 | 63 … | ) |
@@ -105,9 +106,15 @@ | ||
105 | 106 … | h('div.msg', |
106 | 107 … | h('p.small.ri', 'dig'), |
107 | 108 … | h('img.avatar', {src: bloburl + image}), |
108 | 109 … | h('div', vote.value.content.vote.link, |
109 | - h('span.date', mo(vote.value.timestamp).fromNow()) | |
110 … | + h('p.date', mo(vote.value.timestamp).fromNow()), | |
111 … | + h('div.msg', | |
112 … | + h('img.avatar', {src: bloburl + reauthor.image}), | |
113 … | + h('div', {innerHTML: md.block(redo.value.content.text)}, | |
114 … | + h('span.date', mo(redo.value.timestamp).fromNow()) | |
115 … | + ) | |
116 … | + ) | |
110 | 117 … | ) |
111 | 118 … | ) |
112 | 119 … | ) |
113 | 120 … | ).outerHTML) |
Built with git-ssb-web