Closed hermes-diactoros closed 6 years ago
Can you fix the conflict? Sorry, I might have touched something in entry and feed while you were building this part.
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.
This way, even when you don't know this portal, you will see a clickable username.
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.
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..
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.
Ah! yes that's perfect. I will have a look at the edit issue, I think it shouldn't be too hard to implement 👍
Update: cleaner, better mentions the message text is not modified, as mentioned above.
(#73)
Short and simple: messages get scanned for
@user
bits, and Rotonde performs a lookup in the feed. Thetarget
field in theportal.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 thetarget
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:
processed
bool or something similar.@0
,@1
stuff. It should be more user-friendly.