diff options
author | June McEnroe <june@causal.agency> | 2020-01-01 17:05:46 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-01-01 17:06:00 -0500 |
commit | fe029d311ef1abc6eba314930cbfbf71a48f1f13 (patch) | |
tree | 77ab05116dc3f8d130fd536c47aa6f18992b8dd6 /litterbox.c | |
parent | Factor out hashing function (diff) | |
download | litterbox-fe029d311ef1abc6eba314930cbfbf71a48f1f13.tar.gz litterbox-fe029d311ef1abc6eba314930cbfbf71a48f1f13.zip |
Don't special case user being * in queries
It's a side-effect of imports that shouldn't surface elsewhere. Would be nice to have unscoop figure out how it can eliminate using * in more places.
Diffstat (limited to '')
-rw-r--r-- | litterbox.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/litterbox.c b/litterbox.c index 88f342e..31d7198 100644 --- a/litterbox.c +++ b/litterbox.c @@ -200,13 +200,10 @@ static void querySearch(struct Message *msg) { WITH results AS ( SELECT contexts.name AS context, - date(events.time) || 'T' || time(events.time) || 'Z' AS time, + strftime('%Y-%m-%dT%H:%M:%SZ', events.time) AS time, events.type, names.nick, - CASE WHEN names.user = '*' - THEN names.nick - ELSE names.user - END, + names.user, events.target, highlight(search, 6, :bold, :bold), events.event @@ -217,10 +214,11 @@ static void querySearch(struct Message *msg) { WHERE contexts.network = :network AND coalesce(contexts.query = :query, true) AND search MATCH :search - ORDER BY events.time DESC, events.event DESC + ORDER BY time DESC, event DESC LIMIT :limit ) - SELECT * FROM results ORDER BY context, time, event; + SELECT * FROM results + ORDER BY time, event; ); dbPersist(&stmt, sql); dbBindText(stmt, ":bold", "\2"); @@ -229,8 +227,6 @@ static void querySearch(struct Message *msg) { dbBindText(stmt, ":network", network); if (searchQuery == Public) { dbBindInt(stmt, ":query", false); - } else { - dbBindNull(stmt, ":query"); } dbBindText(stmt, ":search", msg->params[1]); |