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 moderation buttons in search popup #2803

Merged
merged 4 commits into from May 23, 2021

Conversation

talneoran
Copy link
Contributor

@talneoran talneoran commented May 21, 2021

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

This PR adds moderation buttons to messages in a search popup opened from a split where moderation mode is active.

While this does seem to work for the cases I tested, I'm not really sure about the implementation and would like some input:

With the way the existing imlementation of adding the MessageElementFlag works, the ChannelView object "queries" the parent widget (by dynamic_cast), expecting it to be a split and checking for moderation mode in that split. The addition here is checking if the parent widget is actually a search popup, fetching the parent of the search widget which should be a split, and using that split to determine moderation mode. I'm just not sure if this is a good way of going about it. (A similar thing applies to determining the channel for performing the moderation actions when clicking the buttons)

To test, simply add whichever moderation buttons you would like to test, open a split with moderation mode enabled, open a search popup, and try the buttons.

Closes #2148

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Good quality of life change for moderators!

@pajlada pajlada merged commit b42f70e into Chatterino:master May 23, 2021
@talneoran talneoran deleted the search-popup-moderation-buttons branch May 23, 2021 19:47
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.

Add moderation buttons for search (ctrl+f)
2 participants