allow . to match all summaries
This commit is contained in:
parent
9539575678
commit
f4dfdcea25
|
@ -2,6 +2,8 @@ changelog
|
||||||
|
|
||||||
=== next
|
=== next
|
||||||
|
|
||||||
|
+ Filter to match anything with summary/warning.
|
||||||
|
|
||||||
+ Start collecting quties.
|
+ Start collecting quties.
|
||||||
|
|
||||||
+ Fix http signatures for GET requests.
|
+ Fix http signatures for GET requests.
|
||||||
|
|
|
@ -51,6 +51,7 @@ fields as well.
|
||||||
.It Ar text
|
.It Ar text
|
||||||
Regular expression match against the post
|
Regular expression match against the post
|
||||||
.Fa content .
|
.Fa content .
|
||||||
|
The special value of "." will match any post with a summary only.
|
||||||
.It Ar is announce
|
.It Ar is announce
|
||||||
Is announced (shared).
|
Is announced (shared).
|
||||||
.It Ar announce of
|
.It Ar announce of
|
||||||
|
|
11
hfcs.go
11
hfcs.go
|
@ -107,7 +107,7 @@ func filtcachefiller(userid int64) (afiltermap, bool) {
|
||||||
expflush = filt.Expiration
|
expflush = filt.Expiration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if t := filt.Text; t != "" {
|
if t := filt.Text; t != "" && t != "." {
|
||||||
wordfront := t[0] != '#'
|
wordfront := t[0] != '#'
|
||||||
wordtail := true
|
wordtail := true
|
||||||
t = "(?i:" + t + ")"
|
t = "(?i:" + t + ")"
|
||||||
|
@ -314,7 +314,7 @@ func matchfilterX(h *Honk, f *Filter) string {
|
||||||
rv += " announce"
|
rv += " announce"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if match && f.Text != "" {
|
if match && f.Text != "" && f.Text != "." {
|
||||||
match = false
|
match = false
|
||||||
re := f.re_text
|
re := f.re_text
|
||||||
m := re.FindString(h.Precis)
|
m := re.FindString(h.Precis)
|
||||||
|
@ -334,6 +334,13 @@ func matchfilterX(h *Honk, f *Filter) string {
|
||||||
rv = m
|
rv = m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if match && f.Text == "." {
|
||||||
|
match = false
|
||||||
|
if h.Precis != "" {
|
||||||
|
match = true
|
||||||
|
rv = h.Precis
|
||||||
|
}
|
||||||
|
}
|
||||||
if match {
|
if match {
|
||||||
return rv
|
return rv
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue