flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

[likes] Don't send liked notification for posts without plain content. #4095

Closed YUCLing closed 1 week ago

YUCLing commented 4 weeks ago

Fixes #0000

Changes proposed in this pull request:

Don't send liked notifications for posts that don't have plain content.

In this approach, the extensibility of the Likes extension won't be reduced. Since it allows all other post types to be liked, it also keeps the original notification ability from the Likes extension for all other post types that contain valid plain content.

Reviewers should focus on:

Screenshot

Necessity

Confirmed

Required changes:

luceos commented 1 week ago

So the issue here is:

Liking any other Post type than CommentPost is causing issues with notifications.

The PR #4075 relates to this exact issue as well.

What I think should happen is create an extensible layer by adding a property to the implementation of every Post type, eg CommentPost that indicates whether notifications should be sent.

I'm closing this PR and the other one and will create an issue to explain further.