git ssb

16+

Dominic / patchbay



Commit 5026c6f808f432b3b52dabce2f2f1ff044390434

upgrade patch-suggest (using new ssb-suggest)

mixmix committed on 1/22/2019, 4:52:34 AM
Parent: 439fbef15cdf6f2dfef52be98bc123702d6b9d2c

Files changed

about/async/suggest.jsdeleted
config.jschanged
package-lock.jsonchanged
package.jsonchanged
about/async/suggest.jsView
@@ -1,42 +1,0 @@
1-const nest = require('depnest')
2-const { onceTrue } = require('mutant')
3-
4-var fallbackImageUrl = 'data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='
5-
6-exports.gives = nest('about.async.suggest')
7-
8-exports.needs = nest({
9- 'blob.sync.url': 'first',
10- 'sbot.obs.connection': 'first'
11-})
12-
13-exports.create = function (api) {
14- return nest('about.async.suggest', suggestedProfile)
15-
16- // TODO rework this top API!
17- function suggestedProfile (text, defaultIds, cb) {
18- if (cb === undefined && typeof defaultIds === 'function') return suggestedProfile(text, [], defaultIds)
19-
20- onceTrue(api.sbot.obs.connection, ssb => {
21- ssb.suggest.profile({ text, defaultIds, limit: 20 }, (err, items) => {
22- if (err) return cb(err)
23-
24- cb(null, items.map(Suggestion))
25- })
26- })
27-
28- return true // stop at this depject
29- }
30-
31- function Suggestion (item) {
32- return {
33- title: item.name,
34- id: item.id,
35- subtitle: item.id.substring(0, 10),
36- value: `[@${item.name}](${item.id})`,
37- cls: item.following ? 'following' : null,
38- image: item.image ? api.blob.sync.url(item.image) : fallbackImageUrl,
39- showBoth: true
40- }
41- }
42-}
config.jsView
@@ -1,7 +1,6 @@
11 const nest = require('depnest')
22 const Config = require('ssb-config/inject')
3-const ssbKeys = require('ssb-keys')
43 const Path = require('path')
54 const merge = require('lodash/merge')
65
76 const appName = process.env.ssb_appname || 'ssb'
@@ -14,9 +13,8 @@
1413 if (config) return config
1514
1615 console.log('LOADING config')
1716 config = Config(appName, opts)
18- // config.keys = ssbKeys.loadOrCreateSync(Path.join(config.path, 'secret'))
1917
2018 config = merge(
2119 config,
2220 Connections(config),
@@ -28,10 +26,10 @@
2826 }
2927
3028 function Connections (config) {
3129 const connections = (process.platform === 'win32')
32- ? undefined // this seems wrong?
33- : { incoming: { unix: [{ 'scope': 'local', 'transform': 'noauth', server: true }] } }
30 + ? undefined
31 + : { incoming: { unix: [{ scope: 'local', transform: 'noauth', server: true }] } }
3432
3533 return connections ? { connections } : {}
3634 }
3735
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 400245 bytes
New file size: 403653 bytes
package.jsonView
@@ -69,9 +69,9 @@
6969 "patch-drafts": "0.0.6",
7070 "patch-history": "^1.0.0",
7171 "patch-inbox": "^1.3.1",
7272 "patch-settings": "^1.1.2",
73- "patch-suggest": "^2.0.2",
73 + "patch-suggest": "^3.0.1",
7474 "patchbay-book": "^1.0.8",
7575 "patchbay-dark-crystal": "^2.0.0",
7676 "patchbay-gatherings": "^3.2.8",
7777 "patchbay-poll": "^1.1.3",
@@ -92,12 +92,11 @@
9292 "ssb-blob-files": "^1.1.3",
9393 "ssb-blobs": "^1.1.6",
9494 "ssb-chess-db": "^1.0.5",
9595 "ssb-chess-mithril": "^1.0.7",
96- "ssb-config": "^2.3.7",
96 + "ssb-config": "^3.2.2",
9797 "ssb-ebt": "^5.2.3",
9898 "ssb-friends": "^3.1.10",
99- "ssb-keys": "^7.0.15",
10099 "ssb-meme": "^1.0.4",
101100 "ssb-mentions": "^0.5.0",
102101 "ssb-mutual": "^0.1.0",
103102 "ssb-private": "^0.2.3",
@@ -105,8 +104,9 @@
105104 "ssb-ref": "^2.13.6",
106105 "ssb-search": "^1.1.2",
107106 "ssb-server": "^13.5.2",
108107 "ssb-sort": "^1.1.0",
108 + "ssb-suggest": "^1.0.2",
109109 "ssb-unread": "^1.0.2",
110110 "ssb-ws": "^4.0.1",
111111 "suggest-box": "^2.2.3",
112112 "text-node-searcher": "^1.1.1",

Built with git-ssb-web