Rotonde / rotonde-client

Rotonde Base Client
https://client-neauoire.hashbase.io/
MIT License
227 stars 49 forks source link

Initial proposal for multiple mentions #87

Closed hermes-diactoros closed 6 years ago

hermes-diactoros commented 6 years ago

(#73)

Short and simple: messages get scanned for @user bits, and Rotonde performs a lookup in the feed. The target field in the portal.json file becomes an array of mentions in order, and the first mention in the message becomes @0, the second @1, etc.

When fetching messages using multiple mentions, Rotonde does the reverse: scans for @[integer] and fetches the portal URL from the target array. It is then substituted by the corresponding username.

Rough around the edges, but backwards compatibility is working, as far as I can see. Needs lots of testing!

Issues:

  1. Messages on the feed are scanned for mentions every single time; we should avoid doing this. Messages could have a processed bool or something similar.
  2. Mentions to people not in your feed or whose portal we haven't connected to yet results in ugly @0,@1 stuff. It should be more user-friendly.
  3. Mentions should be clickable links.
neauoire commented 6 years ago

Can you fix the conflict? Sorry, I might have touched something in entry and feed while you were building this part.

neauoire commented 6 years ago

I think this could be more elegant, maybe instead of @1, @2, @3 -- We could do mentions for each word starting with ~ or @, so when a portal is unknown, instead of seeing a number, you see ~username.

neauoire commented 6 years ago

This way, even when you don't know this portal, you will see a clickable username.

hermes-diactoros commented 6 years ago

So keep the usernames in plain-text, and add their URLs to the target array? What about unknown users, how can we find their portal URL?

Yeah I think that makes things nicer, instead of replacing by @0, @1, etc.

neauoire commented 6 years ago

Oh, you mean like mentioning unknown users even to yourself? You're right, that would offset the index for the lookup in the targets array, yeah. I'm not sure people will often do mentions of people not in their own networks.

[hash1,hash2] for ~known1,~unknown1,known2 would result in ~known1(hash1),~unknown1(hash2) I'm not sure which is more elegant..

hermes-diactoros commented 6 years ago

You mean ~known1(hash1),~unknown1,~known2(hash2)? That sounds good to me. But I think the array should be filled with empty strings for unknown usernames, maybe.

EDIT: e.g. [hash1,null,hash2] for ~known1,~unknown1,@known2 becomes ~known1(hash1),~unknown1,@known2(hash2).

Issue: I have not checked how edits play out with all this stuff. IMO edits should trigger a complete re-scan of the message and target array.

neauoire commented 6 years ago

Ah! yes that's perfect. I will have a look at the edit issue, I think it shouldn't be too hard to implement 👍

hermes-diactoros commented 6 years ago

Update: cleaner, better mentions the message text is not modified, as mentioned above.