mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-09 18:08:00 +00:00
prevent past unfollows from removing an instance
This commit is contained in:
parent
70617fbdf6
commit
b86159c7ae
|
@ -102,7 +102,6 @@ async def handle_follow(view: ActorView, conn: Connection) -> None:
|
|||
view.instance = conn.update_inbox(view.actor.shared_inbox, followid = view.message.id)
|
||||
|
||||
else:
|
||||
with conn.transaction():
|
||||
view.instance = conn.put_inbox(
|
||||
view.actor.domain,
|
||||
view.actor.shared_inbox,
|
||||
|
@ -141,7 +140,10 @@ async def handle_undo(view: ActorView, conn: Connection) -> None:
|
|||
await handle_forward(view, conn)
|
||||
return
|
||||
|
||||
with conn.transaction():
|
||||
# prevent past unfollows from removing an instance
|
||||
if view.instance['followid'] and view.instance['followid'] != view.message.object_id:
|
||||
return
|
||||
|
||||
if not conn.del_inbox(view.actor.id):
|
||||
logging.verbose(
|
||||
'Failed to delete "%s" with follow ID "%s"',
|
||||
|
|
Loading…
Reference in a new issue