diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-04-12 18:53:04 -0700 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-04-12 18:53:04 -0700 |
commit | 7cbc5c587105a7add08d250458303c47bcd0e57a (patch) | |
tree | 220a38fcbe032f84aa4b41b3aa24cd7c5947fd2b | |
parent | 54a38f740689e11173e26aa7176a839f13d52452 (diff) | |
download | patchfoo-7cbc5c587105a7add08d250458303c47bcd0e57a.tar.gz patchfoo-7cbc5c587105a7add08d250458303c47bcd0e57a.zip |
Deduplicate getting follower info
-rw-r--r-- | lib/app.js | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -36,6 +36,10 @@ function App(sbot, config) { this.unboxContent = memo({cache: lru(100)}, sbot.private.unbox) this.reverseNameCache = lru(100) + this.getFriendInfo = memo({cache: false}, this._getFriendInfo) + this.getFollows = memo({cache: false}, this._getFollows) + this.getFollowers = memo({cache: false}, this._getFollowers) + this.unboxMsg = this.unboxMsg.bind(this) this.render = new Render(this, this.opts) @@ -216,7 +220,7 @@ App.prototype.getFollow = function (source, dest, cb) { ) } -App.prototype.getFollows = function (id, cb) { +App.prototype._getFollows = function (id, cb) { var self = this pull( self.sbot.links({source: id, rel: 'contact', values: true}), @@ -233,7 +237,7 @@ App.prototype.getFollows = function (id, cb) { ) } -App.prototype.getFollowers = function (id, cb) { +App.prototype._getFollowers = function (id, cb) { var self = this pull( self.sbot.links({dest: id, rel: 'contact', values: true}), @@ -250,7 +254,7 @@ App.prototype.getFollowers = function (id, cb) { ) } -App.prototype.getFriendInfo = function (id, cb) { +App.prototype._getFriendInfo = function (id, cb) { var self = this var done = multicb({pluck: 1, spread: true}) self.getFollows(id, done()) |