Files: 94f0e4dd667e6f3e2c417ed1c141aaa49f8cdf08 / index.js
1023 bytesRaw
1 | var Get = require('./get') |
2 | var paramap = require('pull-paramap') |
3 | var pull = require('pull-stream') |
4 | var u = require('yap-util') |
5 | |
6 | module.exports = function (sbot) { |
7 | return function (use) { |
8 | use('event', function (opts, apply, req) { |
9 | opts.id = opts.id || "%eFzw9Qca1MUppBgyGG0e2AwzlwonvwDk2GDyxM9B37c=.sha256" |
10 | return function (cb) { |
11 | Get(sbot, opts, function (err, thread) { |
12 | cb(null, require('./render')(apply, thread)) |
13 | }) |
14 | } |
15 | }) |
16 | use('all', function (opts, apply, req) { |
17 | console.log(opts) |
18 | return pull( |
19 | sbot.query.read( |
20 | u.createQuery(Object.assign({ type: 'gathering'}, opts)) |
21 | ), |
22 | // sbot.messagesByType({ |
23 | // type: 'gathering', |
24 | // limit: 10, |
25 | // reverse: true |
26 | // }), |
27 | pull.map(function (e) { |
28 | return apply('/gatherings/event', {id: e.key, private: true}) |
29 | }) |
30 | ) |
31 | }) |
32 | use.map('messages', 'gathering', 'event') |
33 | |
34 | // use.list(' |
35 | } |
36 | } |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 |
Built with git-ssb-web