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

Add upvotes/downvotes #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alopatindev
Copy link

@alopatindev alopatindev commented Jun 9, 2024

I'm not sure whether you're interested in this feature, but anyway, this adds upvotes/likes (+ reactions) and downvotes/dislikes (- reactions). Other reactions are ignored in the vote rating (because considering states like - and at the same time 💩 is a bit complicated).

If any user made several votes to a single message—all of the votes but the newest one will be ignored.

I didn't test it with the relays that don't support publishing reactions from free accounts.

Reactions are sent concurrently Promise.allSettled to the relays (but perhaps they should be sent the same way as comments publishing is done right now).

I didn't manage to make markup properly.

Feel free to make any changes if you find this PR valuable for merging.

@alopatindev alopatindev changed the title Add votes/downvotes Draft: Add votes/downvotes Jun 9, 2024
@alopatindev alopatindev changed the title Draft: Add votes/downvotes Add votes/downvotes Jun 9, 2024
@alopatindev alopatindev changed the title Add votes/downvotes Draft: Add votes/downvotes Jun 9, 2024
@alopatindev alopatindev changed the title Draft: Add votes/downvotes Add votes/downvotes Jun 9, 2024
@alopatindev alopatindev changed the title Add votes/downvotes Add upvotes/downvotes Jun 9, 2024
@alopatindev alopatindev force-pushed the votes branch 5 times, most recently from 0f88f26 to fab5634 Compare June 15, 2024 19:51
@alopatindev alopatindev force-pushed the votes branch 4 times, most recently from bf6dcc2 to 731001f Compare July 4, 2024 15:17
@franzaps
Copy link
Owner

franzaps commented Jul 4, 2024

@alopatindev thank you for this! I have very little time at the moment to review it, but I'll come back to it. I see you keep pushing commits, let me know when you think it's done

@alopatindev
Copy link
Author

Awesome! It's done.

@franzaps
Copy link
Owner

franzaps commented Jul 8, 2024

Why do you keep force pushing?

@alopatindev
Copy link
Author

That was a forgotten minor fix. I'm not going to force-push anything to this branch anymore, sorry if it's annoying or something.

@franzaps
Copy link
Owner

franzaps commented Jul 9, 2024

It's okay, I keep getting notifications but I asked because I didn't understand. When I click I see no changes in file changes and wondered why force push

@alopatindev
Copy link
Author

I force-push to make history cleaner, however, not sure whether it's convenient to use, but GitHub shows diffs with Compare button for each force-push, like if they were normal commits.
1

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.

2 participants