git ssb

2+

ev / mvd



Commit 38591c78a2db671dee180a2c3a615fc50ed6d69c

add user arrival date to profile page

Gwen Bell committed on 6/14/2018, 10:19:34 PM
Parent: eeeffa6970ed465663b4d879e6b0a672b8ad857c

Files changed

render.jschanged
views.jschanged
render.jsView
@@ -30,9 +30,8 @@
3030 message.appendChild(tools.mini(msg, privateMsg))
3131 return message
3232 }*/
3333 else if (msg.value.content.type == 'contact') {
34- console.log(msg)
3534 if (msg.value.content.following == true) {
3635 var following = h('span', ' follows ', h('a', {href: '#' + msg.value.content.contact}, avatar.name(msg.value.content.contact)))
3736 message.appendChild(tools.mini(msg, following))
3837 }
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)
@@ -105,8 +105,17 @@
105105 h('span.avatar--medium', avatar.image(src)),
106106 name
107107 )
108108 )
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 + )
109118
110119 var buttons = h('div.buttons')
111120
112121 profile.firstChild.appendChild(avatars)

Built with git-ssb-web