ssb: Make blocks begin to do something.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 9m21s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 9m21s
This commit is contained in:
18
src/ssb.db.c
18
src/ssb.db.c
@@ -2918,3 +2918,21 @@ void tf_ssb_db_remove_block(sqlite3* db, const char* id)
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
}
|
||||
|
||||
bool tf_ssb_db_is_blocked(sqlite3* db, const char* id)
|
||||
{
|
||||
bool is_blocked = false;
|
||||
sqlite3_stmt* statement = NULL;
|
||||
if (sqlite3_prepare_v2(db, "SELECT 1 FROM blocks WHERE id = ?", -1, &statement, NULL) == SQLITE_OK)
|
||||
{
|
||||
if (sqlite3_bind_text(statement, 1, id, -1, NULL) == SQLITE_OK)
|
||||
{
|
||||
if (sqlite3_step(statement) == SQLITE_ROW)
|
||||
{
|
||||
is_blocked = true;
|
||||
}
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
return is_blocked;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user