Commit b5c29f60805936095ac67ab8d047006f7de94d56
can show a single message, but reply should be in thread
Dominic Tarr committed on 6/20/2016, 2:38:03 AMParent: c395c89410dba096bd2c95c1b7aa0e70c2b6ccc8
Files changed
modules/thread.js | changed |
modules/thread.js | ||
---|---|---|
@@ -35,9 +35,9 @@ | ||
35 | 35 | //a stream. maybe it would be better to accept an array? |
36 | 36 | |
37 | 37 | sbot_get(root, function (err, value) { |
38 | 38 | 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) | |
40 | 40 | |
41 | 41 | pull( |
42 | 42 | sbot_links({rel: 'root', dest: root, values: true, keys: true}), |
43 | 43 | pull.collect(function (err, ary) { |
@@ -47,16 +47,8 @@ | ||
47 | 47 | }) |
48 | 48 | ) |
49 | 49 | }) |
50 | 50 | |
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)) | |
59 | 51 | } |
60 | 52 | |
61 | 53 | exports.screen_view = function (id, sbot) { |
62 | 54 | if(ref.isMsg(id)) { |
@@ -88,8 +80,9 @@ | ||
88 | 80 | //would probably be better keep an id for each message element |
89 | 81 | //(i.e. message key) and then update it if necessary. |
90 | 82 | //also, it may have moved (say, if you received a missing message) |
91 | 83 | content.innerHTML = '' |
84 | + //decrypt | |
92 | 85 | thread = thread.map(function (msg) { |
93 | 86 | return 'string' === typeof msg.value.content ? message_unbox(msg) : msg |
94 | 87 | }) |
95 | 88 | |
@@ -99,9 +92,9 @@ | ||
99 | 92 | }) |
100 | 93 | |
101 | 94 | var branches = sort.heads(thread) |
102 | 95 | 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 | |
104 | 97 | |
105 | 98 | var recps = thread[0].value.content.recps |
106 | 99 | if(recps && thread[0].value.private) |
107 | 100 | meta.recps = recps |
@@ -112,8 +105,4 @@ | ||
112 | 105 | return div |
113 | 106 | } |
114 | 107 | } |
115 | 108 | |
116 | - | |
117 | - | |
118 | - | |
119 | - |
Built with git-ssb-web