Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rethreading metadata #47

Open
wants to merge 5 commits into
base: 🌨️
Choose a base branch
from

Conversation

randomouscrap98
Copy link
Contributor

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:

haloopdy_frontend_rethread
(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:

  • When a rethread happens, the first and last messages are stamped with a rethread object in the values, that looks like:
"values" : {
  "rethread" : {
    "date":"rethread_date",
    "count":11,
    "position":"start|end",
    "lastContentId":123
  }
}
  • Furthermore, ALL messages that are part of the rethread get stamped with an originalContentId which never changes, even if the message gets rethreaded over and over
  • Thus, the rethread value is updated for the start and end messages anytime a rethread occurs, but originalContentId is stamped once and thus will always tell you the original room a message was posted in

I'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 that if statement in draw_part should be all you need to detect a rethread.

Again, feel free to completely change the whole thing, it won't bother me!

@ilovecherries
Copy link
Collaborator

this is how it looks in the frontend btw. it can be changed as needed
image

@y-ack
Copy link
Collaborator

y-ack commented Aug 10, 2023

tested with git fetch origin pull/47/head; git checkout FETCH_HEAD
rethread brackets: START: Rethreaded 19 messages from page 3489 - 3/21/2023, 11:49:34 AM

the styling can be changed, of course, i just still don't know if we need this. does it have to be a setting? needs direction from 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants