Add 'azInvalidUser' condition to az generator

This commit is contained in:
Aykhan Shahsuvarov 2025-05-20 21:28:29 +04:00
parent 588cfc0fcc
commit 74b8324b6f

View File

@ -13,6 +13,10 @@ import (
"go.mongodb.org/mongo-driver/mongo/options"
)
var azInvalidUser []string = []string{
"did:plc:5zww7zorx2ajw7hqrhuix3ba",
}
var azValidUsers []string = []string{
"did:plc:jbt4qi6psd7rutwzedtecsq7",
"did:plc:yzgdpxsklrmfgqmjghdvw3ti",
@ -124,6 +128,10 @@ func (generator *FeedGeneratorAz) IsValid(post *collections.Post) bool {
return false
}
if slices.Contains(azInvalidUser, post.DID) {
return false
}
if slices.Contains(azValidUsers, post.DID) || // Posts from always-valid users
(slices.Contains(post.Langs, "az") && len(post.Langs) < 3) || // Posts in Azerbaijani language with fewer than 3 languages
generator.textRegex.MatchString(post.Text) { // Posts containing Azerbaijan-related keywords