Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup direct sbot usage #115

Merged
merged 27 commits into from
Jul 22, 2021
Merged

Fixup direct sbot usage #115

merged 27 commits into from
Jul 22, 2021

Conversation

soapdog
Copy link
Owner

@soapdog soapdog commented Jul 22, 2021

This is part of #104: identifying all direct usage of sbot.

Some of that usage is easy to refactor right away, such as cases where `sbot.id` is used to get the feed id for the running user. Patchfox has always exposed the feed id as `ssb.feed`, it was just a matter of using it.
* Added `ssb.system.*` namespace. It will be used for SSB workflow stuff such as joining pubs and rooms, inspecting peers. Mostly stuff that goes into the system package.
Removed direct access to `sbot` to join pubs. Refactored to use `ssb.system.acceptInvite()` instead.

This relates to #104
Related to #104 - removing direct sbot access.

The system package has been refactored to use the new functions exposed by `ssb.system.*`.
Related to #104

* Refactored to use `ssb.addBlob`.
* Fixed bug with cover display.
Related to #104

Refactored to use `ssb.addBlob`.
Fixed small bugs.
Fucking editor I was using previously sprinkled bad indentation and semicolons all over the place, and I never spent the necessary time to fix them all. I'm doing it file by file now.
This adds `ssb.friendship.*` which contains functions to help querying for following, followers, and friends of a feed.
* Refactored to use `ssb.friendship.*` instead of `sbot.links`.
* Related to #104
refactoring platform from `ssb` to `nodejs-ssb` to prepare the ground for supporting `go-ssb` and `browsers-ssb` as well.

Related to: #104 #105 #106
closes #106

This allows package developers to create branching code to support different SSB server types.
Each package needs to declare which platforms they suppport. This value needs to match the running server type.

* `pkg.supportedPlatforms = ["nodejs-ssb"]`
* `ssb.serverType = "nodejs-ssb"

All packages patched to include this property.

closes #106
@soapdog soapdog merged commit bc97103 into master Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create flag for packages to detect which platform is being used.
1 participant