Don't show users post content from users they've blocked (#639)
This commit is contained in:
parent
4ff52b5ac0
commit
7e68277eb6
3 changed files with 10 additions and 4 deletions
|
@ -64,13 +64,14 @@ class VisibilityState:
|
|||
op_name_safe=target.author_name
|
||||
)
|
||||
|
||||
def moderated_body(self, v: User | None) -> str | None:
|
||||
def moderated_body(self, v: User | None, is_blocking: bool=False) -> str | None:
|
||||
if v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] \
|
||||
or v.id == self.op_id):
|
||||
return None
|
||||
if self.deleted: return 'Deleted'
|
||||
if self.appear_removed(v): return 'Removed'
|
||||
if self.filtered: return 'Filtered'
|
||||
if is_blocking: return f'You are blocking @{self.op_name_safe}'
|
||||
return None
|
||||
|
||||
def visibility_and_message(self, v: User | None, is_blocking: bool) -> tuple[bool, str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue