From 6855e74c6f18c37bf5efde1e5a456356c4d3630f Mon Sep 17 00:00:00 2001 From: Henri Dickson <90480431+alphatownsman@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:46:31 -0500 Subject: [PATCH] Do not retry unmute if mute never expires --- users/models/block.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/users/models/block.py b/users/models/block.py index 11b48e8..b452a95 100644 --- a/users/models/block.py +++ b/users/models/block.py @@ -37,7 +37,7 @@ class BlockStates(StateGraph): """ # Mutes don't send but might need expiry if instance.mute: - return cls.awaiting_expiry + return cls.awaiting_expiry if instance.expires else cls.sent # Remote blocks should not be here, local blocks just work if not instance.source.local or instance.target.local: return cls.sent @@ -195,8 +195,7 @@ class Block(StatorModel): raise ValueError("You cannot mute from a remote Identity") block = cls.maybe_get(source=source, target=target, mute=True) if block is not None: - if not block.active: - block.state = BlockStates.new # type:ignore + block.state = BlockStates.new # type:ignore if duration: block.expires = timezone.now() + datetime.timedelta(seconds=duration) block.include_notifications = include_notifications