From b8aa11e5cee6a2b45479f37baaf184102b6183a5 Mon Sep 17 00:00:00 2001 From: Justin Warren Date: Sun, 22 Jan 2023 13:15:29 +1100 Subject: [PATCH] Don't merge comments if new comment is empty. --- src/fediblockhole/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fediblockhole/__init__.py b/src/fediblockhole/__init__.py index b9441a5..c1f0c2a 100755 --- a/src/fediblockhole/__init__.py +++ b/src/fediblockhole/__init__.py @@ -286,8 +286,8 @@ def merge_comments(oldcomment:str, newcomment:str) -> str: if oldcomment in ['', None] and newcomment in ['', None]: return '' - # If both comments are the same, don't merge - if oldcomment == newcomment: + # If both comments are the same, or new comment is empty, don't merge + if oldcomment == newcomment or newcomment in ['', None]: return oldcomment # We want to skip duplicate fragments so we don't end up