filter on image desc too
This commit is contained in:
parent
d21f39d0e5
commit
d97d815dae
1 changed files with 16 additions and 2 deletions
18
fun.go
18
fun.go
|
|
@ -71,7 +71,7 @@ func reverbolate(userid int64, honks []*Honk) {
|
||||||
h.Precis = unpucker(h.Precis)
|
h.Precis = unpucker(h.Precis)
|
||||||
h.Noise = unpucker(h.Noise)
|
h.Noise = unpucker(h.Noise)
|
||||||
h.Open = "open"
|
h.Open = "open"
|
||||||
if badword := unsee(zilences, h.Precis, h.Noise); badword != "" {
|
if badword := unsee(zilences, h.Precis, h.Noise, h.Donks); badword != "" {
|
||||||
if h.Precis == "" {
|
if h.Precis == "" {
|
||||||
h.Precis = badword
|
h.Precis = badword
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +142,7 @@ func translate(honk *Honk) {
|
||||||
honk.Onts = oneofakind(ontologies(honk.Noise))
|
honk.Onts = oneofakind(ontologies(honk.Noise))
|
||||||
}
|
}
|
||||||
|
|
||||||
func unsee(zilences []*regexp.Regexp, precis string, noise string) string {
|
func unsee(zilences []*regexp.Regexp, precis string, noise string, donks []*Donk) string {
|
||||||
for _, z := range zilences {
|
for _, z := range zilences {
|
||||||
if z.MatchString(precis) || z.MatchString(noise) {
|
if z.MatchString(precis) || z.MatchString(noise) {
|
||||||
if precis == "" {
|
if precis == "" {
|
||||||
|
|
@ -151,6 +151,15 @@ func unsee(zilences []*regexp.Regexp, precis string, noise string) string {
|
||||||
}
|
}
|
||||||
return precis
|
return precis
|
||||||
}
|
}
|
||||||
|
for _, d := range donks {
|
||||||
|
if z.MatchString(d.Desc) {
|
||||||
|
if precis == "" {
|
||||||
|
w := z.String()
|
||||||
|
return w[6 : len(w)-3]
|
||||||
|
}
|
||||||
|
return precis
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
@ -164,6 +173,11 @@ outer:
|
||||||
if z.MatchString(h.Precis) || z.MatchString(h.Noise) {
|
if z.MatchString(h.Precis) || z.MatchString(h.Noise) {
|
||||||
continue outer
|
continue outer
|
||||||
}
|
}
|
||||||
|
for _, d := range h.Donks {
|
||||||
|
if z.MatchString(d.Desc) {
|
||||||
|
continue outer
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
honks[j] = h
|
honks[j] = h
|
||||||
j++
|
j++
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue