Commit 5d4b2827385d502e718d74eaf45c889ea46eb1bf
don't try to look for friends following buffers
Henry committed on 4/16/2017, 5:21:58 PMParent: f7384d0a56873550f614d9757d05739e84a6a6ec
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -50,9 +50,11 @@ | ||
50 | 50 … | getAddress: 'sync' |
51 | 51 … | } |
52 | 52 … | |
53 | 53 … | 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.') | |
55 | 57 … | } |
56 | 58 … | |
57 | 59 … | exports.init = function (sbot, config) { |
58 | 60 … | |
@@ -64,9 +66,9 @@ | ||
64 | 66 … | |
65 | 67 … | var server = http.createServer(JSONApi(sbot)).listen(port) |
66 | 68 … | |
67 | 69 … | 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) { | |
69 | 71 … | if(err) return cb(err) |
70 | 72 … | else if(follows) cb(null, {allow: READ_AND_ADD, deny: null}) |
71 | 73 … | else cb() |
72 | 74 … | }) |
Built with git-ssb-web