mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Start supporting a server blocklist
This commit is contained in:
@ -26,6 +26,7 @@ from app.actor import fetch_actor
|
||||
from app.actor import save_actor
|
||||
from app.ap_object import RemoteObject
|
||||
from app.config import BASE_URL
|
||||
from app.config import BLOCKED_SERVERS
|
||||
from app.config import ID
|
||||
from app.config import MANUALLY_APPROVES_FOLLOWERS
|
||||
from app.database import AsyncSession
|
||||
@ -1447,6 +1448,10 @@ async def save_to_inbox(
|
||||
logger.exception("Failed to fetch actor")
|
||||
return
|
||||
|
||||
if actor.server in BLOCKED_SERVERS:
|
||||
logger.warning(f"Server {actor.server} is blocked")
|
||||
return
|
||||
|
||||
if "id" not in raw_object:
|
||||
await _process_transient_object(db_session, raw_object, actor)
|
||||
return None
|
||||
|
Reference in New Issue
Block a user