staltz / ssb-room

A server to find and connect to other SSB peers – a meeting place. AGPL-3.0
GNU Affero General Public License v3.0
109 stars 17 forks source link

Setting about information for a room. #12

Open HendrikPetertje opened 3 years ago

HendrikPetertje commented 3 years ago

Hey, Thanks for the amazing work you've done so far on this ssb-room project! As the title suggests, I got bit of a question.

I've been trying to give my new room a name, picture and description. the only commands that seem to be available when executing ssb-room seem to be:

ssb-room start (which is performed in Dockerfile)
ssb-room check (which is performed in Dockerfile)

When I however execute the second one with an ssb-room running I get the error:

{ message: 'no async:whoami',
  name: 'Error',
  stack:
   'Error: no async:whoami\n    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:29:13)\n    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:37:22)\n    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/stream.js:48:17)\n    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:161:17)\n    at PacketStream.write (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:134:41)\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/pull-weird.js:56:15\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-stream/sinks/drain.js:24:37\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11\n    at Object.cb (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream-codec/index.js:111:11)\n    at drain (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-reader/index.js:39:14)' }

Is there a way to set the name, description and profile pic for an SSB room?

edit: Slightly more readable stack-trace from error above:

Error: no async:whoami
    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:29:13)
    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:37:22)
    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/stream.js:48:17)
    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:161:17)
    at PacketStream.write (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:134:41)
    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/pull-weird.js:56:15
    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-stream/sinks/drain.js:24:37
    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11
    at Object.cb (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream-codec/index.js:111:11)
    at drain (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-reader/index.js:39:14)
staltz commented 3 years ago

@HendrikPetertje Thanks for the issue

Rooms are essentially not SSB identities. My goal with this was to try avoiding them becoming entities in the social graph, when it doesn't make much sense. E.g. rooms can be compared to SSB in LAN, because you see other peers and can connect to them. It wouldn't make sense to SSB follow a Wi-Fi access point, would it? And Wi-Fi access points don't have profile pictures, so why should room servers have them?

Regarding the specific error thrown, I think we don't have the whoami API. We could, though. I think there is a muxrpc API to get the name of the room server at least. It's a bit difficult for me to see that now on mobile, but I think it's there.

HendrikPetertje commented 3 years ago

Good point! As I read on through your code I started to piece together the same concept when I saw that the room for its identity (name) relies on the config file rather than the log. and your reasoning (which I've read in a few different places at this point) fits well with how it's constructed.

I noticed that your app (manyverse) picks up the name and has a neat distinct icon to point out the "identity" is just a room, I didn't notice this in apps like Patchwork and Patchbay where real identities get mixed with rooms in their "online" sections. I'm pretty swamped at my day-job right now, but I'll see if I can help out with a pull request over there to make it a bit clearer that the connected client is a room.

That said and circling back to the original question: The room config file includes a name and description, is just the name relayed to connected ssb-clients or could that object be expanded to in some sense add an image (image-blob ID) and an in_app_description of some kind? Sure, one's not really supposed to connect to a room as a one would connect to a "friend", but I'm probably not the only one that likes to decorate spaces.

image

thanks for taking the time to try to explain things. If you think this is just a weird idea; then by all means feel free to close this issue.