Comments (2)
@clehner I ended up pushing a removal of the code that relied on ssb-conn
before seeing the PR you sent. The code below your changes was part of trying to implement Rooms 2.0 HTTP Auth but it didn't work, and it couldn't work because the flow needs to happen in the backend, not the front-end. In essence, that code was a leftover from an attempt to implement a feature.
This commit pushes both that removal, a version bump, and a prebuilt webextension in the dist/
folder. It should work for you and fix #113
Be aware that there is one last piece of code that relies in ssb-conn
to work and that is joining rooms 2.0.
From src/core/platforms/ssb/rooms2.js
:
connectAndRemember: (address) => {
return new Promise((resolve, reject) => {
ssb.sbot.conn.connect(address, (err, data) => {
if (err) {
reject(err)
} else {
ssb.sbot.conn.remember(address)
resolve({address, data})
}
})
})
},
I will figure out a way to provide a version of that that doesn't rely on ssb-conn. Do you have any tips about how to do it?
Except for that feature, the rest of Patchfox should work for you now. Unless there are other plugins I'm relying on that you don't have, but that is good because I want to make this more agnostic and would gladly patch patchfox to solve these situations.
from patchfox.
@soapdog I would suggest to call sbot.gossip.connect
if ssb-gossip
is present and not ssb-conn
.
I don't think a separate "remember" step is needed, since although ssb-gossip
has gossip.add
, the gossip.connect
implementation calls it already internally.
I haven't tested this with actual rooms.
From 021296dd70aa9e1098663ac50d4d42320608b224 Mon Sep 17 00:00:00 2001
From: "Charles E. Lehner" <[email protected]>
Date: Mon, 14 Jun 2021 21:17:49 -0400
Subject: [PATCH] Support ssb-gossip in connectAndRemember
---
src/core/platforms/ssb/rooms2.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/core/platforms/ssb/rooms2.js b/src/core/platforms/ssb/rooms2.js
index fdad5c9..41beb63 100644
--- a/src/core/platforms/ssb/rooms2.js
+++ b/src/core/platforms/ssb/rooms2.js
@@ -17,11 +17,19 @@ const rooms2 = {
},
connectAndRemember: (address) => {
return new Promise((resolve, reject) => {
- ssb.sbot.conn.connect(address, (err, data) => {
+ let gossipOrConn = ssb.sbot.gossip || ssb.sbot.conn
+ if (!gossipOrConn) {
+ return reject(new Error('Missing ssb-gossip or ssb-conn'))
+ }
+ gossipOrConn.connect(address, (err, data) => {
if (err) {
reject(err)
} else {
- ssb.sbot.conn.remember(address)
+ if (ssb.sbot.conn) {
+ ssb.sbot.conn.remember(address)
+ } else {
+ // gossip.connect calls gossip.add internally
+ }
resolve({address, data})
}
})
--
2.30.2
from patchfox.
Related Issues (20)
- Improve `platforms/nodejs-ssb` HOT 2
- Create flag for packages to detect which platform is being used. HOT 2
- [[ settings ]] refactor to support multiple identities
- refactor app launching to account for multiple identities HOT 1
- Support multiple server and identities connections HOT 12
- Patchfox as a minimum viable primary client
- Copy-editing the docs HOT 3
- Can't build: copyfiles "can't go up that far" HOT 4
- Preferences for font size
- Abililty to browse posts from people I follow HOT 2
- [[ blog ]] attaching a thumbnail to a blog post is not working
- default identity not being automatically set
- settings broken for new users HOT 6
- issue to delete identity HOT 1
- Issue when blocking spam HOT 1
- linux 64 bit patchfox-2022.9.2-alpha can't start up HOT 1
- Change setup screen messaging if Patchfox creates the profile
- Very low-level level error when opening the app
- Patchfox does not create profile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patchfox.