Commit 1142ba9b914b1fd19b2b8816d4f7496a264abe5a
if a message was private, but without recps, pick a reasonable default: sender + receiver.
Dominic Tarr committed on 10/15/2016, 6:21:10 PMParent: 0130f94de3e3c309fedf1f4ef5c26e6ea20d2bab
Files changed
modules/thread.js | changed |
modules/thread.js | |||
---|---|---|---|
@@ -5,8 +5,9 @@ | |||
5 | 5 … | var ref = require('ssb-ref') | |
6 | 6 … | var h = require('hyperscript') | |
7 | 7 … | var u = require('../util') | |
8 | 8 … | var Scroller = require('pull-scroll') | |
9 … | +var self_id = require('../keys').id | ||
9 | 10 … | ||
10 | 11 … | function once (cont) { | |
11 | 12 … | var ended = false | |
12 | 13 … | return function (abort, cb) { | |
@@ -98,14 +99,22 @@ | |||
98 | 99 … | meta.root = thread[0].value.content.root || thread[0].key | |
99 | 100 … | meta.channel = thread[0].value.content.channel | |
100 | 101 … | ||
101 | 102 … | var recps = thread[0].value.content.recps | |
102 | - if(recps && thread[0].value.private) | ||
103 | - meta.recps = recps | ||
103 … | + var private = thread[0].value.private | ||
104 … | + if(private) { | ||
105 … | + if(recps) | ||
106 … | + meta.recps = recps | ||
107 … | + else | ||
108 … | + meta.recps = [thread[0].value.author, self_id] | ||
109 … | + } | ||
104 | 110 … | }) | |
105 | 111 … | } | |
106 | 112 … | ||
107 | 113 … | loadThread() | |
108 | 114 … | return div | |
109 | 115 … | } | |
110 | 116 … | } | |
111 | 117 … | ||
118 … | + | ||
119 … | + | ||
120 … | + | ||
Built with git-ssb-web