this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: proper multivalue switch cases, fix receiver-from-object-id case

+8 -19
+5 -14
churros.go
··· 77 77 } 78 78 79 79 return post.GroupID, nil 80 - case EventShotgunClosesSoon: 81 - case EventShotgunOpensSoon: 80 + case EventShotgunClosesSoon, EventShotgunOpensSoon: 82 81 event, err := prisma.Event.FindUnique( 83 82 db.Event.ID.Equals(msg.ChurrosObjectId), 84 83 ).Exec(context.Background()) ··· 86 85 return "", fmt.Errorf("while getting the group responsible for the notification: %w", err) 87 86 } 88 87 return event.GroupID, nil 89 - case EventCustom: 90 - case EventGodchildAccepted: 91 - case EventGodchildRejected: 92 - case EventGodchildRequest: 93 - case EventTest: 88 + case EventCustom, EventGodchildAccepted, EventGodchildRejected, EventGodchildRequest, EventTest: 94 89 return "", nil 95 90 } 96 91 ··· 101 96 switch msg.Event { 102 97 case EventNewPost: 103 98 return db.NotificationChannelArticles 104 - case EventShotgunClosesSoon: 105 - case EventShotgunOpensSoon: 99 + case EventShotgunClosesSoon, EventShotgunOpensSoon: 106 100 return db.NotificationChannelShotguns 107 - case EventCommentReply: 108 - case EventNewComment: 101 + case EventCommentReply, EventNewComment: 109 102 return db.NotificationChannelComments 110 - case EventGodchildRequest: 111 - case EventGodchildAccepted: 112 - case EventGodchildRejected: 103 + case EventGodchildRequest, EventGodchildAccepted, EventGodchildRejected: 113 104 return db.NotificationChannelGodparentRequests 114 105 } 115 106
+3 -5
users.go
··· 42 42 return receiversForCommentReply(message) 43 43 case EventContributionPaid: 44 44 return receiversForContributionPaid(message) 45 - case EventGodchildAccepted: 46 - case EventGodchildRejected: 45 + case EventGodchildAccepted, EventGodchildRejected: 47 46 return receiversForGodchildResponse(message) 48 47 case EventGodchildRequest: 49 48 return receiversForGodchildRequest(message) ··· 58 57 _, err := prisma.User.FindUnique( 59 58 db.User.ID.Equals(message.ChurrosObjectId), 60 59 ).Exec(context.Background()) 61 - if err != nil { 60 + if err == nil { 62 61 return []string{message.ChurrosObjectId}, nil 63 62 } 64 63 } ··· 91 90 } 92 91 93 92 switch post.Visibility { 94 - case db.VisibilityPrivate: 95 - case db.VisibilityUnlisted: 93 + case db.VisibilityPrivate, db.VisibilityUnlisted: 96 94 return []string{}, nil 97 95 case db.VisibilityPublic: 98 96 return AllUsers()