diff --git a/database.go b/database.go index 1edbe1a..fc04cfe 100644 --- a/database.go +++ b/database.go @@ -303,6 +303,26 @@ func gethonksbysearch(userid int64, q string, wanted int64) []*Honk { if t == "" { continue } + if t == "@me" { + queries = append(queries, "whofore = 1") + continue + } + if t == "@self" { + queries = append(queries, "(whofore = 2 or whofore = 3)") + continue + } + if strings.HasPrefix(t, "before:") { + before := t[7:] + queries = append(queries, "dt < ?") + params = append(params, before) + continue + } + if strings.HasPrefix(t, "after:") { + after := t[6:] + queries = append(queries, "dt > ?") + params = append(params, after) + continue + } if strings.HasPrefix(t, "site:") { site := t[5:] site = "%" + site + "%" diff --git a/docs/changelog.txt b/docs/changelog.txt index 5a58c78..e4d7e82 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -2,6 +2,8 @@ changelog === next ++ Improved search. + + Tuned up superdeliverator. + Import from instagram. diff --git a/docs/honk.1 b/docs/honk.1 index a5578e0..4b4582a 100644 --- a/docs/honk.1 +++ b/docs/honk.1 @@ -143,10 +143,18 @@ section of the manual for details of honk composition. Find old honks. It's basic substring match with a few extensions. The following keywords are supported: -.Bl -tag -width honker -.It site +.Bl -tag -width honker: +.It @me +Honks mentioning the user. +.It @self +Honks by the user. +.It before: +Honks posted before YYYY-MM-DD. +.It after: +As above. +.It site: Substring match on the post domain name. -.It honker +.It honker: Exact match, either AP actor or honker nickname. .It - Negate term.