summary refs log tree commit diff
path: root/litterbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'litterbox.c')
-rw-r--r--litterbox.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/litterbox.c b/litterbox.c
index e37f78a..1401112 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -258,21 +258,24 @@ static void handlePing(struct Message *msg) {
 
 static const struct {
 	const char *cmd;
+	bool transaction;
 	Handler *fn;
 } Handlers[] = {
-	{ "001", handleReplyWelcome },
-	{ "005", handleReplyISupport },
-	{ "CAP", handleCap },
-	{ "NOTICE", handlePrivmsg },
-	{ "PING", handlePing },
-	{ "PRIVMSG", handlePrivmsg },
+	{ "001", false, handleReplyWelcome },
+	{ "005", false, handleReplyISupport },
+	{ "CAP", false, handleCap },
+	{ "NOTICE", true, handlePrivmsg },
+	{ "PING", false, handlePing },
+	{ "PRIVMSG", true, handlePrivmsg },
 };
 
 static void handle(struct Message msg) {
 	if (!msg.cmd) return;
 	for (size_t i = 0; i < ARRAY_LEN(Handlers); ++i) {
 		if (strcmp(msg.cmd, Handlers[i].cmd)) continue;
+		dbExec(db, SQL(BEGIN TRANSACTION;));
 		Handlers[i].fn(&msg);
+		dbExec(db, SQL(COMMIT TRANSACTION;));
 		break;
 	}
 }
.sh?id=7699681b6a6f056e04cb799cdfa0d3e0db370fa2&follow=1'>Set LANG in cgit filtersJune McEnroe 2019-12-20Source .editrc before applying -v or -eJune McEnroe 2019-12-20Disable signing commitsJune McEnroe 2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe