This repository has no description
0

Configure Feed

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

fix: remove code related to comments

-60
-2
churros.go
··· 108 108 return db.NotificationChannelArticles 109 109 case EventShotgunClosesSoon, EventShotgunOpensSoon: 110 110 return db.NotificationChannelShotguns 111 - case EventCommentReply, EventNewComment: 112 - return db.NotificationChannelComments 113 111 case EventGodchildRequest, EventGodchildAccepted, EventGodchildRejected: 114 112 return db.NotificationChannelGodparentRequests 115 113 }
-2
events.go
··· 17 17 EventClearSchedule Event = "clear_schedule" 18 18 EventNewPost Event = "new_post" 19 19 EventGodchildRequest Event = "godchild_request" 20 - EventNewComment Event = "new_comment" 21 - EventCommentReply Event = "comment_reply" 22 20 EventCustom Event = "custom" 23 21 EventTest Event = "test" 24 22 EventGodchildAccepted Event = "godchild_accepted"
-56
users.go
··· 34 34 switch message.Event { 35 35 case EventNewPost: 36 36 return receiversForPost(message) 37 - case EventNewComment: 38 - return receiversForNewComment(message) 39 37 case EventBookingPaid: 40 38 return receiversForBookingPaid(message) 41 - case EventCommentReply: 42 - return receiversForCommentReply(message) 43 39 case EventContributionPaid: 44 40 return receiversForContributionPaid(message) 45 41 case EventGodchildAccepted, EventGodchildRejected: ··· 110 106 return userIds, fmt.Errorf("unknown post visibility %q", post.Visibility) 111 107 } 112 108 113 - func receiversForNewComment(message Message) (userIds []string, err error) { 114 - comment, err := prisma.Comment.FindUnique( 115 - db.Comment.ID.Equals(message.ChurrosObjectId), 116 - ).With( 117 - db.Comment.Article.Fetch(), 118 - ).Exec(context.Background()) 119 - if err != nil { 120 - err = fmt.Errorf("while getting comment: %w", err) 121 - return 122 - } 123 - 124 - post, ok := comment.Article() 125 - if !ok { 126 - err = fmt.Errorf("comment %q has no parent post", comment.ID) 127 - return 128 - } 129 - 130 - authorId, ok := post.AuthorID() 131 - if !ok { 132 - err = fmt.Errorf("post %q has no author", post.ID) 133 - return 134 - } 135 - 136 - return []string{authorId}, nil 137 - } 138 - 139 109 func receiversForBookingPaid(message Message) (userIds []string, err error) { 140 110 booking, err := prisma.Registration.FindUnique( 141 111 db.Registration.ID.Equals(message.ChurrosObjectId), ··· 157 127 } 158 128 159 129 return 160 - } 161 - 162 - func receiversForCommentReply(message Message) (userIds []string, err error) { 163 - comment, err := prisma.Comment.FindUnique( 164 - db.Comment.ID.Equals(message.ChurrosObjectId), 165 - ).With( 166 - db.Comment.InReplyTo.Fetch(), 167 - ).Exec(context.Background()) 168 - if err != nil { 169 - err = fmt.Errorf("while getting comment: %w", err) 170 - return 171 - } 172 - 173 - parent, ok := comment.InReplyTo() 174 - if !ok { 175 - err = fmt.Errorf("comment %q has no parent", comment.ID) 176 - return 177 - } 178 - 179 - authorId, ok := parent.AuthorID() 180 - if !ok { 181 - err = fmt.Errorf("comment %q has no author", parent.ID) 182 - return 183 - } 184 - 185 - return []string{authorId}, nil 186 130 } 187 131 188 132 func receiversForContributionPaid(message Message) (userIds []string, err error) {