From fbc1eb51713f0fe32eadf62fd3f3022b009097d4 Mon Sep 17 00:00:00 2001 From: Howo Date: Tue, 16 Dec 2025 15:19:47 -0500 Subject: [PATCH] Remove higher reputation requirement for reputation calculation Remove the requirement that a voter must have higher reputation than the author for downvotes to affect the author's reputation. This simplifies the calculation by eliminating circular dependencies. The voter still needs explicit reputation (not implicit) for their downvotes to have an effect, maintaining consistency with the existing system while removing the arbitrary higher-rep constraint. --- db/backend.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/backend.sql b/db/backend.sql index c3a2798..e6d5f0a 100644 --- a/db/backend.sql +++ b/db/backend.sql @@ -108,8 +108,8 @@ BEGIN --- Author must have set explicit reputation to allow its correction --- Voter must have explicitly set reputation to match hived old conditions -IF NOT _author_is_implicit AND _voter_reputation >= 0 AND - (_prev_rshares >= 0 OR (_prev_rshares < 0 AND NOT _voter_is_implicit AND _voter_reputation > _author_reputation - (_prev_rshares >> 6)::BIGINT)) THEN +IF NOT _author_is_implicit AND _voter_reputation >= 0 AND + (_prev_rshares >= 0 OR (_prev_rshares < 0 AND NOT _voter_is_implicit)) THEN _author_reputation := _author_reputation - (_prev_rshares >> 6)::BIGINT; _author_is_implicit := _author_reputation = 0; @@ -123,7 +123,7 @@ IF NOT _author_is_implicit AND _voter_reputation >= 0 AND END IF; -IF _voter_reputation >= 0 AND (_rshares >= 0 OR (_rshares < 0 AND NOT _voter_is_implicit AND _voter_reputation > _author_reputation)) THEN +IF _voter_reputation >= 0 AND (_rshares >= 0 OR (_rshares < 0 AND NOT _voter_is_implicit)) THEN _is_changed := TRUE; _author_reputation := _author_reputation + (_rshares >> 6)::BIGINT; -- GitLab