diff options
Diffstat (limited to '')
-rw-r--r-- | litterbox.c | 14 | ||||
-rw-r--r-- | scoop.c | 5 |
2 files changed, 6 insertions, 13 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]); diff --git a/scoop.c b/scoop.c index 6caafe9..0bf3230 100644 --- a/scoop.c +++ b/scoop.c @@ -179,10 +179,7 @@ static const char *Inner = SQL( strftime(coalesce(:format, '%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, names.host, events.target, highlight(search, 6, :open, :close), |