diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-05 14:33:53 -0800 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-05 15:10:53 -0800 |
commit | 00885846f2c98059a4b95b2d18b4a4a8f22f7901 (patch) | |
tree | 1e62d9daca99798042356b9b470880fcc2e7d503 /lib/render.js | |
parent | 9898ecb4b08704b162719cac5810ce095a96b545 (diff) | |
download | patchfoo-00885846f2c98059a4b95b2d18b4a4a8f22f7901.tar.gz patchfoo-00885846f2c98059a4b95b2d18b4a4a8f22f7901.zip |
List friends following feed
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/render.js b/lib/render.js index ed011bb..95c8c50 100644 --- a/lib/render.js +++ b/lib/render.js @@ -562,3 +562,21 @@ Render.prototype.npmPrebuildMention = function (link, opts, cb) { ])) }) } + +Render.prototype.friendsList = function (prefix) { + prefix = prefix || '/' + var self = this + return pull( + paramap(function (id, cb) { + self.app.getAbout(id, function (err, about) { + var name = about && about.name || id.substr(0, 8) + '…' + cb(null, h('a', {href: self.toUrl(prefix + id)}, name)) + }) + }, 8), + pull.map(function (el) { + return [el, ' '] + }), + pull.flatten(), + pull.map(u.toHTML) + ) +} |