Commit c0ee0528003bc98da07846b27cf4fc5ed3ea6832
Merge branch 'howlong' of ssb://%NPNNvcnTMZUFZSWl/2Z4XX+YSdqsqOhyPacp+lgpQUw=.sha256
Add @gb's pull-request, showing arrival timeEv Bogue committed on 6/18/2018, 11:27:05 PM
Parent: 6aea4b873ff737ed770a8d922111a4a85243b095
Parent: 38591c78a2db671dee180a2c3a615fc50ed6d69c
Files changed
views.js | changed |
views.js | ||
---|---|---|
@@ -1,5 +1,6 @@ | ||
1 | 1 | var pull = require('pull-stream') |
2 | +var human = require('human-time') | |
2 | 3 | var sbot = require('./scuttlebot') |
3 | 4 | var hyperscroll = require('hyperscroll') |
4 | 5 | var More = require('pull-more') |
5 | 6 | var stream = require('hyperloadmore/stream') |
@@ -88,9 +89,8 @@ | ||
88 | 89 | createStream({reverse: true, live: false, limit: 10, id: src}), |
89 | 90 | stream.bottom(content) |
90 | 91 | ) |
91 | 92 | |
92 | - | |
93 | 93 | var profile = h('div.content#profile', h('div.message')) |
94 | 94 | |
95 | 95 | if (screen.firstChild.firstChild) { |
96 | 96 | screen.firstChild.insertBefore(profile, screen.firstChild.firstChild) |
@@ -103,8 +103,17 @@ | ||
103 | 103 | h('span.avatar--medium', avatar.image(src)), |
104 | 104 | avatar.name(src) |
105 | 105 | ) |
106 | 106 | ) |
107 | + | |
108 | + pull( | |
109 | + sbot.userStream({id: src, reverse: false, limit: 1}), | |
110 | + pull.drain(function (msg) { | |
111 | + var howlong = h('span', ' arrived ', human(new Date(msg.value.timestamp))) | |
112 | + avatars.appendChild(howlong) | |
113 | + console.log(msg) | |
114 | + }) | |
115 | + ) | |
107 | 116 | |
108 | 117 | var name = avatar.name(src) |
109 | 118 | |
110 | 119 | var buttons = h('div.buttons') |
Built with git-ssb-web