fix handle_follow and handle_undo

This commit is contained in:
Izalia Mae 2024-01-24 19:55:11 -05:00
parent b8aae4c1bb
commit b59ead5d05

View file

@ -17,7 +17,7 @@ cache = LRUCache(1024)
def person_check(actor: str, software: str) -> bool: def person_check(actor: str, software: str) -> bool:
# pleroma and akkoma may use Person for the actor type for some reason # pleroma and akkoma may use Person for the actor type for some reason
# akkoma changed this in a 3.6.0 # akkoma changed this in 3.6.0
if software in {'akkoma', 'pleroma'} and actor.id == f'https://{actor.domain}/relay': if software in {'akkoma', 'pleroma'} and actor.id == f'https://{actor.domain}/relay':
return False return False
@ -62,7 +62,7 @@ async def handle_follow(view: ActorView) -> None:
with view.database.connection() as conn: with view.database.connection() as conn:
# reject if software used by actor is banned # reject if software used by actor is banned
if view.config.is_banned_software(software): if conn.get_software_ban(software):
view.app.push_message( view.app.push_message(
view.actor.shared_inbox, view.actor.shared_inbox,
Message.new_response( Message.new_response(
@ -141,7 +141,7 @@ async def handle_undo(view: ActorView) -> None:
return return
with view.database.connection() as conn: with view.database.connection() as conn:
if not conn.del_inbox(view.actor.inbox): if not conn.del_inbox(view.actor.id):
logging.verbose( logging.verbose(
'Failed to delete "%s" with follow ID "%s"', 'Failed to delete "%s" with follow ID "%s"',
view.actor.id, view.actor.id,