← Back to Roadmap

Snapshot profile details upon blocking

Phase: In development

Our goal is to publish a new variant of the contact message when we are blocking:

  type: 'contact',
  contact: "@wasdwaSdAwasDWsAsDaSD=.ed25519",
  blocking: true,
  following: false,
  about: {
    name: "Alice",
    blurhash: "LlMF%n00%#MwS|WCWEM{R*bbWBbH"
  • Change ssb/utils/to-ssb such that new blocks (type: contact) msgs include msg.value.content.about with about.name
  • On the ContactBody component, if there is no contactName, display msg.value.content.about.name instead, and if that doesn't exist, then fallback to msg.value.content.contact
  • Start a repo called ssb-blobs-blurhash with dependencies ssb-blobs and blurhash and sharp
  • As a proof of concept, sharp can take a hard-coded fs path to an image file (preferably square) as input and you can play around with sharp APIs, to resize, output, etc and get familiar with sharp
  • Use sharp to produce a blurhash code for the hard-coded image: the sharp pipeline should take the hard-coded image as input, resize it (blurhash likes thumbnail sized images) to be a small square, and output Uint8ClampedArray which blurhash wants for encode, and then generate the blurhash, and test it online at https://mad-gooze.github.io/fast-blurhash/
  • ssb-blobs-blurhash has one main method generate(blobId, opts, cb) (not sure if opts is needed, but good to reserve that)
  • generate will take the blobId, and with ssb-blobs API, get the full Buffer for the image. The idea is to pump all that Buffer into sharp for processing, and get a Uint8ClampedArray that blurhash needs
  • generate should detect the image dimensions and use NxN blurhash "components" (this is a blurhash-specific parameter) if the image is square, but use MxN blurhash components if the image is not square, where M is somewhat proportional to width and N somewhat proportional to height
  • Manyverse: use ssb-blobs-blurhash in the backend to produce a blurhash code that'll be put in the msg.value.content.about of a blocking contact msg
  • For a blocked account, fetch their name and blurhash from our snapshot
  • Use react-blurhash in Electron
  • Display snapshot name and blurhash on the Profile screen
  • sharp works on Electron
  • Use react-native-blurhash on Android/iOS
  • sharp works on Android https://github.com/achou11/ssb-blobs-blurhash/pull/4
  • sharp works on iOS https://github.com/achou11/ssb-blobs-blurhash/pull/4
  • Write down the message schema in the Interoperability wiki
  • Profile should load all details at once
  • New block contact msg should immediately refresh Profile
  • Measure with console.time how long blurhash creation lasts on mobile
  • Final test on Android
  • Final test on iOS
  • Final test on desktop