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

Improved comment-type handling #1072

Merged
merged 13 commits into from
Dec 12, 2024
Merged

Improved comment-type handling #1072

merged 13 commits into from
Dec 12, 2024

Conversation

pfefferle
Copy link
Member

It now uses the comment-type as index and keeps a list of mapped activity-types.

Also added a function to get the comment-type by the activity-type.

Comment::get_comment_type_by_activity_type

props @obenland

It now uses the comment-type as index and keeps a list of mapped activity-types.

Also added a function to get the comment-type by the activity-type.

`Comment::get_comment_type_by_activity_type `

props @obenland
@pfefferle pfefferle requested a review from a team December 11, 2024 16:31
@obenland
Copy link
Member

With this change, get_comment_type_names() could be deprecated in favor of get_comment_type_slugs() and just return array_keys( self::get_comment_types() )

pfefferle and others added 3 commits December 11, 2024 17:39
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
@pfefferle pfefferle requested review from obenland and a team December 11, 2024 23:01
@pfefferle pfefferle self-assigned this Dec 12, 2024
@pfefferle pfefferle requested a review from obenland December 12, 2024 19:12
Covers new and unused methods, as well as deprecated ones
@@ -111,14 +111,13 @@ public static function add_reaction( $activity ) {
return false;
}

$type = $activity['type'];
$comment_type = Comment::get_comment_type_by_activity_type( $activity['type'] );
Copy link
Member

Choose a reason for hiding this comment

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

Could there ever be multiple comment types for an activity type? Is that something we have to worry about?

Copy link
Member Author

@pfefferle pfefferle Dec 12, 2024

Choose a reason for hiding this comment

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

I don't think so... there is the possibility that we might store items in different places (direct messages for example), but that is a different discussion...

@pfefferle pfefferle merged commit 253cfff into trunk Dec 12, 2024
24 checks passed
@pfefferle pfefferle deleted the improve/comment-type-handling branch December 12, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants