git ssb

30+

cel / git-ssb-web



Commit 2ec4c75b9f6a1dec550137036f6caeba13597fe4

Don't show private repos in public mode

cel committed on 7/25/2017, 4:14:57 AM
Parent: 607f737e93d7ffc3353f8df5ef0e5eef35221fa6

Files changed

index.jschanged
lib/util.jschanged
index.jsView
@@ -111,8 +111,9 @@
111111 this.getRepo = asyncMemo({
112112 cache: new LRUCache(32)
113113 }, function (id, cb) {
114114 this.getMsg(id, function (err, msg) {
115 + if (msg.private && this.isPublic) return cb(new Error('Private Repo'))
115116 if (err) return cb(err)
116117 ssbGit.getRepo(ssb, msg, {live: true}, cb)
117118 })
118119 })
lib/util.jsView
@@ -202,8 +202,9 @@
202202 if (err || !content) return cb(null, msg) // leave message encrypted
203203 var msg1 = {}
204204 for (var k in msg) msg1[k] = msg[k]
205205 msg1.value = {}
206 + msg1.private = true
206207 for (var j in msg.value) msg1.value[j] = msg.value[j]
207208 msg1.value.private = true
208209 msg1.value.content = content
209210 if (!content.recps) {

Built with git-ssb-web