mirror of
https://git.kiwifarms.net/mint/fedi-block-api.git
synced 2024-10-22 23:29:06 +00:00
Handle it both sides
This commit is contained in:
parent
03aa6e3560
commit
c29326745b
1 changed files with 3 additions and 2 deletions
5
api.py
5
api.py
|
@ -136,13 +136,14 @@ def mutual(domains: list[str] = Query()):
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(
|
||||||
"SELECT block_level FROM blocks " \
|
"SELECT block_level FROM blocks " \
|
||||||
"WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a OR blocked = :w)) " \
|
"WHERE ((blocker = :a OR blocker = :b) AND (blocked = :b OR blocked = :a OR blocked = :aw OR blocked = :bw)) " \
|
||||||
"AND block_level = 'reject' " \
|
"AND block_level = 'reject' " \
|
||||||
"LIMIT 1",
|
"LIMIT 1",
|
||||||
{
|
{
|
||||||
"a": domains[0],
|
"a": domains[0],
|
||||||
"w": "*." + domains[0],
|
|
||||||
"b": domains[1],
|
"b": domains[1],
|
||||||
|
"aw": "*." + domains[0],
|
||||||
|
"bw": "*." + domains[1],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
res = c.fetchone()
|
res = c.fetchone()
|
||||||
|
|
Loading…
Reference in a new issue