git ssb

16+

Dominic / patchbay



Commit b5c29f60805936095ac67ab8d047006f7de94d56

can show a single message, but reply should be in thread

Dominic Tarr committed on 6/20/2016, 2:38:03 AM
Parent: c395c89410dba096bd2c95c1b7aa0e70c2b6ccc8

Files changed

modules/thread.jschanged
modules/thread.jsView
@@ -35,9 +35,9 @@
3535 //a stream. maybe it would be better to accept an array?
3636
3737 sbot_get(root, function (err, value) {
3838 var msg = {key: root, value: value}
39- if(value.content.root) return getThread(value.content.root, cb)
39+// if(value.content.root) return getThread(value.content.root, cb)
4040
4141 pull(
4242 sbot_links({rel: 'root', dest: root, values: true, keys: true}),
4343 pull.collect(function (err, ary) {
@@ -47,16 +47,8 @@
4747 })
4848 )
4949 })
5050
51-// return pull(Cat([
52-// once(function (cb) {
53-// sbot_get(root, function (err, value) {
54-// cb(err, {key: root, value: value})
55-// })
56-// }),
57-// sbot_links({rel: 'root', dest: root, values: true, keys: true})
58-// ]), pull.collect(cb))
5951 }
6052
6153 exports.screen_view = function (id, sbot) {
6254 if(ref.isMsg(id)) {
@@ -88,8 +80,9 @@
8880 //would probably be better keep an id for each message element
8981 //(i.e. message key) and then update it if necessary.
9082 //also, it may have moved (say, if you received a missing message)
9183 content.innerHTML = ''
84+ //decrypt
9285 thread = thread.map(function (msg) {
9386 return 'string' === typeof msg.value.content ? message_unbox(msg) : msg
9487 })
9588
@@ -99,9 +92,9 @@
9992 })
10093
10194 var branches = sort.heads(thread)
10295 meta.branch = branches.length > 1 ? branches : branches[0]
103- meta.root = thread[0].key
96+ meta.root = thread[0].value.content.root || thread[0].key
10497
10598 var recps = thread[0].value.content.recps
10699 if(recps && thread[0].value.private)
107100 meta.recps = recps
@@ -112,8 +105,4 @@
112105 return div
113106 }
114107 }
115108
116-
117-
118-
119-

Built with git-ssb-web