Commit 673f1c3e0d3f41220ad06d849135a029dd6aa8cc
add latest mention
Ev Bogue committed on 9/15/2016, 10:27:15 PMParent: da746f37c4647de40e6fd6a9f2ae5efdbb60ef4d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -17,11 +17,9 @@ | ||
17 | 17 … | http.createServer(function (req, res){ |
18 | 18 … | if (req.url === '/') { |
19 | 19 … | client(function (err, sbot) { |
20 | 20 … | avatar(sbot, me, me, function (err, avatar){ |
21 | - if (err) { | |
22 | - throw err; | |
23 | - } | |
21 … | + if (err) throw err | |
24 | 22 … | name = avatar.name; |
25 | 23 … | image = avatar.image; |
26 | 24 … | }) |
27 | 25 … | pull( |
@@ -63,9 +61,13 @@ | ||
63 | 61 … | ) |
64 | 62 … | pull( |
65 | 63 … | sbot.query.read({query: [{$filter: { value: { content: {mentions: [{link: me}]}}}}], limit: 1, reverse: true}), |
66 | 64 … | pull.drain(function (data) { |
67 | - mention = data | |
65 … | + avatar(sbot, me, data.value.author, function (err, avatar){ | |
66 … | + if (err) throw err | |
67 … | + mentionauthor = avatar | |
68 … | + }) | |
69 … | + mention = data | |
68 | 70 … | }) |
69 | 71 … | ) |
70 | 72 … | pull( |
71 | 73 … | sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'git-update'}}}}], limit: 1, reverse: true}), |
@@ -114,9 +116,17 @@ | ||
114 | 116 … | h('span.date', mo(redo.value.timestamp).fromNow()) |
115 | 117 … | ) |
116 | 118 … | ) |
117 | 119 … | ) |
120 … | + ), | |
121 … | + h('div.msg', | |
122 … | + h('p.small.ri', 'last mention'), | |
123 … | + h('img.avatar', {src: bloburl + mentionauthor.image}), | |
124 … | + h('div', {innerHTML: md.block(mention.value.content.text)}, | |
125 … | + h('span.date', mo(mention.value.timestamp).fromNow()) | |
126 … | + ) | |
118 | 127 … | ) |
128 … | + | |
119 | 129 … | ) |
120 | 130 … | ).outerHTML) |
121 | 131 … | } |
122 | 132 … | } |
Built with git-ssb-web