Merge pull request #218 from christianbundy/fix-like

Fix likes not working with Patchwork as server
This commit is contained in:
Jonathan Dahan 2020-02-17 11:43:48 -05:00 committed by GitHub
commit 5b37240067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 11 deletions

View File

@ -4,15 +4,17 @@
"words": [
"AGPL",
"Argyris",
"backlinks",
"christianbundy",
"dogfood",
"Hintjens",
"hyperaxe",
"hyperscript",
"Kata",
"LGPL",
"Machinekit",
"OSSEC",
"Pieter",
"backlinks",
"christianbundy",
"dogfood",
"hyperaxe",
"hyperscript",
"manyverse",
"minlength",
"monokai",
@ -21,16 +23,16 @@
"muxrpc",
"nanohtml",
"nosniff",
"OSSEC",
"paramap",
"patchbay",
"patchfoo",
"patchfox",
"Pieter",
"promisify",
"rebecca",
"recps",
"roadmap",
"sameorigin",
"sbot",
"shortname",
"socio",
"ssbc",

View File

@ -4,6 +4,7 @@
// to call methods over MuxRPC. It's a thin wrapper around SSB-Client, which is
// a thin wrapper around the MuxRPC module.
const { promisify } = require("util");
const ssbClient = require("ssb-client");
const ssbConfig = require("ssb-config");
const flotilla = require("@fraction/flotilla");
@ -30,6 +31,9 @@ const rawConnect = () =>
//
// See: https://github.com/fraction/oasis/issues/21
api.tangle = ssbTangle.init(api);
// MuxRPC supports promises but the raw plugin does not.
api.tangle.branch = promisify(api.tangle.branch);
}
resolve(api);
@ -46,7 +50,10 @@ const createConnection = config => {
log("Using pre-existing Scuttlebutt server instead of starting one");
resolve(ssb);
})
.catch(() => {
.catch(e => {
if (e.message !== "could not connect to sbot") {
throw e;
}
log("Initial connection attempt failed");
log("Starting Scuttlebutt server");
server(config);
@ -80,9 +87,6 @@ module.exports = ({ offline }) => {
const config = {
conn: {
autostart: !offline
},
ws: {
http: false
}
};