Add moderation buttons in search popup #2803
Merged
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.
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
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, theChannelView
object "queries" the parent widget (bydynamic_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