diff --git a/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql b/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql index 8ba240e612fd7db6cb7caf7ad1825de21c84791e..01c451c26375b36a503ce0db59bdf14090b74ff3 100644 --- a/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql +++ b/hive/db/sql_scripts/bridge_get_ranked_post_for_communities.sql @@ -481,7 +481,7 @@ $function$ language plpgsql STABLE; DROP FUNCTION IF EXISTS bridge_get_ranked_post_by_created_for_community; -CREATE FUNCTION bridge_get_ranked_post_by_created_for_community( in _community VARCHAR, in _author VARCHAR, in _permlink VARCHAR, in _limit SMALLINT, in _bridge_api BOOLEAN ) +CREATE FUNCTION bridge_get_ranked_post_by_created_for_community( in _community VARCHAR, in _author VARCHAR, in _permlink VARCHAR, in _limit SMALLINT, in _bridge_api BOOLEAN, in _observer VARCHAR ) RETURNS SETOF bridge_api_post AS $function$ @@ -542,6 +542,7 @@ BEGIN LIMIT _limit ) as created JOIN hive_posts_view hp ON hp.id = created.id + WHERE (CASE WHEN _observer IS NOT NULL THEN NOT EXISTS (SELECT 1 FROM muted_accounts_view WHERE observer = _observer AND muted = hp.author) ELSE true END) ORDER BY created.id DESC LIMIT _limit; END diff --git a/hive/server/bridge_api/methods.py b/hive/server/bridge_api/methods.py index 9d9583df52a309b6b9e7656d1b7bb11caf05af11..da44d47d35337f4bbe62bca6ddecb27d22056e0c 100644 --- a/hive/server/bridge_api/methods.py +++ b/hive/server/bridge_api/methods.py @@ -252,7 +252,7 @@ async def get_ranked_posts(context, sort:str, start_author:str='', start_permlin return await process_query_results(result) if tag and tag[:5] == 'hive-': - result = await _get_ranked_posts_for_communities(db, sort, tag, start_author, start_permlink, limit) + result = await _get_ranked_posts_for_communities(db, sort, tag, start_author, start_permlink, limit, observer) return await process_query_results(result) if ( tag and tag != "all" ):