Files: 8ecc2b31db3e6fad1ecee253703e89b979f4ae62 / modules / relationships.js
488 bytesRaw
1 | |
2 | var plugs = require('../plugs') |
3 | |
4 | var sbot_links2 = plugs.first(exports.sbot_links2 = []) |
5 | |
6 | //this is a bit crude, and doesn't actually show unfollows yet. |
7 | |
8 | exports.follows = function (id, cb) { |
9 | return sbot_links2({query: [ |
10 | {"$filter": {"source": id, "rel": ["contact", true, false] }}, |
11 | {"$map": "dest"} |
12 | ]}) |
13 | } |
14 | |
15 | exports.followers = function (id) { |
16 | return sbot_links2({query: [ |
17 | {"$filter": {"dest": id, "rel": ["contact", true, false] }}, |
18 | {"$map": "source"} |
19 | ]}) |
20 | } |
21 | |
22 | |
23 | |
24 |
Built with git-ssb-web