git ssb

0+

Dominic / ssb-ws



Commit 5d4b2827385d502e718d74eaf45c889ea46eb1bf

don't try to look for friends following buffers

Henry committed on 4/16/2017, 5:21:58 PM
Parent: f7384d0a56873550f614d9757d05739e84a6a6ec

Files changed

index.jschanged
index.jsView
@@ -50,9 +50,11 @@
5050 getAddress: 'sync'
5151 }
5252
5353 function toId(id) {
54- return '@'+id.toString('base64')+'.ed25519'
54 + if (typeof id !== 'string') {
55 + return '@' + id.toString('base64') + '.ed25519' // isn't this available somewhere else?
56 + } else throw new Error('toId() called on string. todo: clean this your mess.')
5557 }
5658
5759 exports.init = function (sbot, config) {
5860
@@ -64,9 +66,9 @@
6466
6567 var server = http.createServer(JSONApi(sbot)).listen(port)
6668
6769 function _auth (id, cb) {
68- sbot.friends.get({source: sbot.id, dest: id}, function (err, follows) {
70 + sbot.friends.get({source: sbot.id, dest: toId(id)}, function (err, follows) {
6971 if(err) return cb(err)
7072 else if(follows) cb(null, {allow: READ_AND_ADD, deny: null})
7173 else cb()
7274 })

Built with git-ssb-web