2024-03-15 23:20:11 +01:00
|
|
|
import UserRepo from "repositories/UserRepo";
|
|
|
|
import { Database } from "bun:sqlite";
|
2024-03-15 18:41:08 +01:00
|
|
|
|
2024-03-15 23:20:11 +01:00
|
|
|
function checkAutoProxy
|
2024-03-15 18:41:08 +01:00
|
|
|
(
|
2024-03-15 23:20:11 +01:00
|
|
|
userId: string,
|
2024-03-15 18:41:08 +01:00
|
|
|
database: Database
|
2024-03-15 23:20:11 +01:00
|
|
|
)
|
2024-03-15 18:41:08 +01:00
|
|
|
{
|
2024-03-15 23:20:11 +01:00
|
|
|
const repo = new UserRepo(database)
|
|
|
|
const user_id = repo.getIdByRevoltId(userId)
|
|
|
|
const is_enabled = repo.isProxyEnabled(user_id)
|
|
|
|
return is_enabled
|
2024-03-15 18:41:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export default checkAutoProxy;
|