summary refs log tree commit diff
path: root/litterbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'litterbox.c')
-rw-r--r--litterbox.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/litterbox.c b/litterbox.c
index a291ad0..70a5185 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -231,7 +231,7 @@ static void handleReplyMOTD(struct Message *msg) {
 static void handleReplyEndOfMOTD(struct Message *msg) {
 	const char *sql = SQL(
 		INSERT OR IGNORE INTO motds (time, network, motd)
-		VALUES (coalesce(datetime(:time), datetime('now')), :network, :motd);
+		VALUES (strftime('%s', coalesce(:time, 'now')), :network, :motd);
 	);
 	sqlite3_stmt *stmt = dbPrepare(sql);
 	dbBindText(stmt, ":time", msg->time);
@@ -253,7 +253,7 @@ static void querySearch(struct Message *msg) {
 		WITH results AS (
 			SELECT
 				contexts.name AS context,
-				strftime('%Y-%m-%dT%H:%M:%SZ', events.time) AS time,
+				strftime('%Y-%m-%dT%H:%M:%SZ', events.time, 'unixepoch') AS time,
 				events.type,
 				names.nick,
 				names.user,
@@ -377,7 +377,7 @@ static void insertEvent(
 	const char *sql = SQL(
 		INSERT INTO events (time, type, context, name, target, message)
 		SELECT
-			coalesce(datetime(:time), datetime('now')),
+			strftime('%s', coalesce(:time, 'now')),
 			:type, context, names.name, :target, :message
 		FROM contexts, names
 		WHERE contexts.network = :network
@@ -435,7 +435,7 @@ static void insertTopic(
 	static sqlite3_stmt *stmt;
 	const char *sql = SQL(
 		INSERT OR IGNORE INTO topics (time, context, topic)
-		SELECT coalesce(datetime(:time), datetime('now')), context, :topic
+		SELECT strftime('%s', coalesce(:time, 'now')), context, :topic
 		FROM contexts WHERE network = :network AND name = :context;
 	);
 	dbPersist(&stmt, sql);
@@ -546,7 +546,7 @@ static void insertEvents(
 	const char *sql = SQL(
 		INSERT INTO events (time, type, context, name, target, message)
 		SELECT
-			coalesce(datetime(:time), datetime('now')),
+			strftime('%s', coalesce(:time, 'now')),
 			:type, context, names.name, :target, :message
 		FROM joins, contexts, names
 		WHERE joins.nick = :nick
>June McEnroe 2012-01-28Update to Quicktask 1.1June McEnroe 2012-01-22Use space-test branch of quicktaskJune McEnroe 2012-01-22Enable syntax-based foldingJune McEnroe 2012-01-22Update quicktaskJune McEnroe 2012-01-22Revert "Add AutoClose"June McEnroe This reverts commit 39cfdd62ba82f93f68a2b5fa7b5771303d8b9dee. This fixes the delay when leaving insert mode 2012-01-22Revert "Disable powerline for now"June McEnroe This reverts commit fa48f5965c57272e616721d92475cd2f1e35f667. 2012-01-22Revert "Add VCS repo directories to wildignore"June McEnroe This reverts commit 41cb1db33ba7b64d8af63bf55bb82f7e8a617518. This fixes not being able to commit with vim-fugitive 2012-01-22Disable powerline for nowJune McEnroe 2012-01-22Update some pluginsJune McEnroe 2012-01-22Add VCS repo directories to wildignoreJune McEnroe 2012-01-22Map ,e and ,b to CtrlP file and buffer respectivelyJune McEnroe 2012-01-22Add vim-spaceJune McEnroe 2012-01-22Add AutoCloseJune McEnroe 2012-01-22Add binding for GundoJune McEnroe 2012-01-22Add GundoJune McEnroe 2012-01-22Add Jellybeans colorschemeJune McEnroe 2012-01-22Add syntasticJune McEnroe 2012-01-21Add PowerlineJune McEnroe 2012-01-21Add quicktaskJune McEnroe 2012-01-15Moved comments out of mapsJune McEnroe 2012-01-14Disable scrollbarsJune McEnroe