forked from forks/microblog.pub
Improve actor-level blocking
This commit is contained in:
parent
4f98ff6bbf
commit
d381bb3fec
2 changed files with 29 additions and 23 deletions
|
@ -1219,6 +1219,7 @@ async def _handle_read_activity(
|
||||||
wrapped_object_actor = await fetch_actor(
|
wrapped_object_actor = await fetch_actor(
|
||||||
db_session, ap.get_actor_id(wrapped_object)
|
db_session, ap.get_actor_id(wrapped_object)
|
||||||
)
|
)
|
||||||
|
if not wrapped_object_actor.is_blocked:
|
||||||
ro = RemoteObject(wrapped_object, actor=wrapped_object_actor)
|
ro = RemoteObject(wrapped_object, actor=wrapped_object_actor)
|
||||||
|
|
||||||
# Then process it likes it's coming from a forwarded activity
|
# Then process it likes it's coming from a forwarded activity
|
||||||
|
@ -1666,7 +1667,10 @@ async def save_to_inbox(
|
||||||
announced_actor = await fetch_actor(
|
announced_actor = await fetch_actor(
|
||||||
db_session, ap.get_actor_id(announced_raw_object)
|
db_session, ap.get_actor_id(announced_raw_object)
|
||||||
)
|
)
|
||||||
announced_object = RemoteObject(announced_raw_object, announced_actor)
|
if not announced_actor.is_blocked:
|
||||||
|
announced_object = RemoteObject(
|
||||||
|
announced_raw_object, announced_actor
|
||||||
|
)
|
||||||
announced_inbox_object = models.InboxObject(
|
announced_inbox_object = models.InboxObject(
|
||||||
server=urlparse(announced_object.ap_id).hostname,
|
server=urlparse(announced_object.ap_id).hostname,
|
||||||
actor_id=announced_actor.id,
|
actor_id=announced_actor.id,
|
||||||
|
|
|
@ -76,6 +76,8 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac
|
||||||
# TODO(ts):
|
# TODO(ts):
|
||||||
#
|
#
|
||||||
# Next:
|
# Next:
|
||||||
|
# - support Move
|
||||||
|
# - support actor delete
|
||||||
# - allow to share old notes
|
# - allow to share old notes
|
||||||
# - allow to interact with object not in anybox (i.e. like from a lookup)
|
# - allow to interact with object not in anybox (i.e. like from a lookup)
|
||||||
# - only show 10 most recent threads in DMs
|
# - only show 10 most recent threads in DMs
|
||||||
|
|
Loading…
Reference in a new issue