Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The API now automatically stamps the start and end message of a rethread with rethread metadata. It is already in production, so it's ready to be used. On my frontend, it looks something like:
(a rethread of just three messages)
You can see all the information here: https://github.com/randomouscrap98/contentapi/wiki/Breaking-Changes#december-19th-2022, but to summarize:
rethread
object in the values, that looks like:originalContentId
which never changes, even if the message gets rethreaded over and overrethread
value is updated for the start and end messages anytime a rethread occurs, butoriginalContentId
is stamped once and thus will always tell you the original room a message was posted inI've added code to your frontend in this pull request which will render the same annotation as my frontend, just a simple div with some links (but reformatted for your link format). However, I did NOT actually display it anywhere, instead I log it, because I don't know what you want to do with it. It IS part of a "message-part", but it seems difficult to insert anywhere. Maybe as its own element between message parts? I feel like that might break stuff, so I wanted to leave that up to you. Also, feel free to change the formatting or completely rewrite the
draw_rethread
function. I display the alternate original post if the original post does not equal the lastContentId, I think this is an important usability mode which will likely never happen, but it's up to you how you want to handle that. Basically, all the cases should be handled by that display code, and thatif
statement indraw_part
should be all you need to detect a rethread.Again, feel free to completely change the whole thing, it won't bother me!