views.jsView |
---|
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 | 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) |
105 | 105 | h('span.avatar--medium', avatar.image(src)), |
106 | 106 | name |
107 | 107 | ) |
108 | 108 | ) |
| 109 | + |
| 110 | + pull( |
| 111 | + sbot.userStream({id: src, reverse: false, limit: 1}), |
| 112 | + pull.drain(function (msg) { |
| 113 | + var howlong = h('span', ' arrived ', human(new Date(msg.value.timestamp))) |
| 114 | + avatars.appendChild(howlong) |
| 115 | + console.log(msg) |
| 116 | + }) |
| 117 | + ) |
109 | 118 | |
110 | 119 | var buttons = h('div.buttons') |
111 | 120 | |
112 | 121 | profile.firstChild.appendChild(avatars) |