Skip to content

A scuttlebot plugin that provides a stream of which feeds are (and are not) the same as other feeds.

Notifications You must be signed in to change notification settings

ssb-junkyard/ssb-same-as

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssb-same-as

A scuttlebot plugin that provides a stream of which feeds are (and are not) the same as other feeds.

The basis for creating the illusion of multi-feed identities in SSB!

Based on ssb-friends and graphreduce

TODO

  • need to test merge blocking and unmerging
  • hook into replication to ensure the correct feeds are replicated
  • improve realtime performance (avoid re-traversing entire graph)

Spec

Assert that you are the same as another feed

{
  type: 'contact',
  contact: TARGET_FEED_ID,
  following: true, // for backwards compat reasons
  sameAs: true
}

Block a sameAs

{
  type: 'contact',
  contact: TARGET_FEED_ID,
  following: true, // for backwards compat reasons
  sameAs: false
}

Agree with another feed's assertion

{
  type: 'contact',
  contact: TARGET_FEED_ID,
  following: true, // for backwards compat reasons
  sameAs: {
    SOURCE_FEED_ID: true // or `false` to remove an agreement
  }
}

Logic behind sameAs resolution

  • If one side explicitly disagrees (with a sameAs: false), the identities will NEVER be merged.
  • If both sides agree, the identity will ALWAYS be merged.
  • If one side agrees (and the other side has not shared an opinion), and you agree, then the identities will be merged.
  • In all other cases, the identities will not be merged.

This module uses graphreduce to walk the sameAs links, so this means that any topology of links will be resolved.

Exposed API (as sbot plugin)

sbot.sameAs.stream({live: false, sync: true, old: true}) source

Gets a list of all of the resolved and verified sameAs links between feeds.

{from: 'a', to: 'b', value: true}
{from: 'a', to: 'c', value: true}
{from: 'a', to: 'd', value: true}
{from: 'b', to: 'a', value: true}
{from: 'b', to: 'c', value: true}
{from: 'b', to: 'd', value: true}
...

sbot.sameAs.get({id}, cb) async

Gets a list of all of the verified sameAs links for a given feed.

{
  'b': true,
  'c': true,
  'd': true
}

License

MIT

About

A scuttlebot plugin that provides a stream of which feeds are (and are not) the same as other feeds.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published