git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Commit c0ee0528003bc98da07846b27cf4fc5ed3ea6832

Merge branch 'howlong' of ssb://%NPNNvcnTMZUFZSWl/2Z4XX+YSdqsqOhyPacp+lgpQUw=.sha256

Add @gb's pull-request, showing arrival time
Ev Bogue committed on 6/18/2018, 11:27:05 PM
Parent: 6aea4b873ff737ed770a8d922111a4a85243b095
Parent: 38591c78a2db671dee180a2c3a615fc50ed6d69c

Files changed

views.jschanged
views.jsView
@@ -1,5 +1,6 @@
11 var pull = require('pull-stream')
2+var human = require('human-time')
23 var sbot = require('./scuttlebot')
34 var hyperscroll = require('hyperscroll')
45 var More = require('pull-more')
56 var stream = require('hyperloadmore/stream')
@@ -88,9 +89,8 @@
8889 createStream({reverse: true, live: false, limit: 10, id: src}),
8990 stream.bottom(content)
9091 )
9192
92-
9393 var profile = h('div.content#profile', h('div.message'))
9494
9595 if (screen.firstChild.firstChild) {
9696 screen.firstChild.insertBefore(profile, screen.firstChild.firstChild)
@@ -103,8 +103,17 @@
103103 h('span.avatar--medium', avatar.image(src)),
104104 avatar.name(src)
105105 )
106106 )
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+ )
107116
108117 var name = avatar.name(src)
109118
110119 var buttons = h('div.buttons')

Built with git-ssb-web