git ssb

16+

cel / patchfoo



Commit 7cbc5c587105a7add08d250458303c47bcd0e57a

Deduplicate getting follower info

cel committed on 4/13/2017, 1:53:04 AM
Parent: 54a38f740689e11173e26aa7176a839f13d52452

Files changed

lib/app.jschanged
lib/app.jsView
@@ -35,8 +35,12 @@
3535 getAbout.bind(this), sbot, sbot.id)
3636 this.unboxContent = memo({cache: lru(100)}, sbot.private.unbox)
3737 this.reverseNameCache = lru(100)
3838
39 + this.getFriendInfo = memo({cache: false}, this._getFriendInfo)
40 + this.getFollows = memo({cache: false}, this._getFollows)
41 + this.getFollowers = memo({cache: false}, this._getFollowers)
42 +
3943 this.unboxMsg = this.unboxMsg.bind(this)
4044
4145 this.render = new Render(this, this.opts)
4246 }
@@ -215,9 +219,9 @@
215219 }, false, cb)
216220 )
217221 }
218222
219-App.prototype.getFollows = function (id, cb) {
223 +App.prototype._getFollows = function (id, cb) {
220224 var self = this
221225 pull(
222226 self.sbot.links({source: id, rel: 'contact', values: true}),
223227 pull.filter(function (msg) {
@@ -232,9 +236,9 @@
232236 }, {}, cb)
233237 )
234238 }
235239
236-App.prototype.getFollowers = function (id, cb) {
240 +App.prototype._getFollowers = function (id, cb) {
237241 var self = this
238242 pull(
239243 self.sbot.links({dest: id, rel: 'contact', values: true}),
240244 pull.filter(function (msg) {
@@ -249,9 +253,9 @@
249253 }, {}, cb)
250254 )
251255 }
252256
253-App.prototype.getFriendInfo = function (id, cb) {
257 +App.prototype._getFriendInfo = function (id, cb) {
254258 var self = this
255259 var done = multicb({pluck: 1, spread: true})
256260 self.getFollows(id, done())
257261 self.getFollowers(id, done())

Built with git-ssb-web