From b7a607371627db36e378ae86469d25da57f4445d Mon Sep 17 00:00:00 2001 From: Martin Lees <drov0@users.noreply.github.com> Date: Tue, 12 Sep 2023 10:04:37 -0400 Subject: [PATCH] Fix process_community_post making posts unmuted if their parents are muted --- hive/db/sql_scripts/hive_post_operations.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hive/db/sql_scripts/hive_post_operations.sql b/hive/db/sql_scripts/hive_post_operations.sql index cddd5607a..2e5b0963c 100644 --- a/hive/db/sql_scripts/hive_post_operations.sql +++ b/hive/db/sql_scripts/hive_post_operations.sql @@ -47,7 +47,7 @@ BEGIN __community_id := NULL; ELSE IF is_comment = TRUE THEN - SELECT hc.type_id, hc.id INTO __community_type_id, __community_id + SELECT hc.type_id, hc.id, hivemind_app.hive_posts.is_muted INTO __community_type_id, __community_id, __is_muted FROM hivemind_app.hive_permlink_data JOIN hivemind_app.hive_posts ON hivemind_app.hive_permlink_data.id = hivemind_app.hive_posts.permlink_id JOIN hivemind_app.hive_communities hc ON hivemind_app.hive_posts.community_id = hc.id @@ -56,7 +56,8 @@ BEGIN SELECT type_id, id INTO __community_type_id, __community_id from hivemind_app.hive_communities where name = _parent_permlink; END IF; - IF __community_id IS NOT NULL THEN + -- __is_muted can be TRUE here if it's a comment and its parent is muted + IF __community_id IS NOT NULL AND __is_muted = FALSE THEN IF __community_type_id = __community_type_topic THEN __is_muted := FALSE; ELSE -- GitLab