From 95f4f88949e141ab58a7064557efee1787e52181 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 12 Feb 2025 18:03:53 -0500 Subject: [PATCH] ssb: Non-expiring invites were still broken. --- src/ssb.db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssb.db.c b/src/ssb.db.c index c0534bbb..800d347b 100644 --- a/src/ssb.db.c +++ b/src/ssb.db.c @@ -2255,7 +2255,7 @@ bool tf_ssb_db_use_invite(sqlite3* db, const char* id) { bool used = false; sqlite3_stmt* statement; - if (sqlite3_prepare(db, "UPDATE invites SET use_count = use_count - 1 WHERE invite_public_key = ? AND expires >= ? AND (use_count > 0 OR use_count = -1)", -1, &statement, + if (sqlite3_prepare(db, "UPDATE invites SET use_count = use_count - 1 WHERE invite_public_key = ? AND (expires < 0 OR expires >= ?) AND (use_count > 0 OR use_count = -1)", -1, &statement, NULL) == SQLITE_OK) { if (sqlite3_bind_text(statement, 1, id, -1, NULL) == SQLITE_OK && sqlite3_bind_int64(statement, 2, (int64_t)time(NULL)) == SQLITE_OK)