appview/notify/db: set hard-limit to @-mention notification #759

merged
opened by boltless.me targeting master from feat/mentions
Changed files
+7
appview
notify
db
+7
appview/notify/db/db.go
···
"tangled.org/core/idresolver"
)
+
const (
+
maxMentions = 5
+
)
+
type databaseNotifier struct {
db *db.DB
res *idresolver.Resolver
···
issueId *int64,
pullId *int64,
) {
+
if eventType == models.NotificationTypeUserMentioned && len(recipients) > maxMentions {
+
recipients = recipients[:maxMentions]
+
}
recipientSet := make(map[syntax.DID]struct{})
for _, did := range recipients {
// everybody except actor themselves