👔 Add conditions to notify subscribers new post
This commit is contained in:
@@ -51,6 +51,11 @@ public class PublisherSubscriptionService(
|
|||||||
/// <returns>The number of subscribers notified</returns>
|
/// <returns>The number of subscribers notified</returns>
|
||||||
public async Task<int> NotifySubscriberPost(Post.Post post)
|
public async Task<int> NotifySubscriberPost(Post.Post post)
|
||||||
{
|
{
|
||||||
|
if (post.RepliedPostId is not null)
|
||||||
|
return 0;
|
||||||
|
if (post.Visibility != PostVisibility.Public)
|
||||||
|
return 0;
|
||||||
|
|
||||||
var subscribers = await db.PublisherSubscriptions
|
var subscribers = await db.PublisherSubscriptions
|
||||||
.Where(p => p.PublisherId == post.PublisherId &&
|
.Where(p => p.PublisherId == post.PublisherId &&
|
||||||
p.Status == PublisherSubscriptionStatus.Active)
|
p.Status == PublisherSubscriptionStatus.Active)
|
||||||
|
Reference in New Issue
Block a user