forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

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

Signed-off-by: Seongmin Lee <git@boltless.me>

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