Skip to content
Snippets Groups Projects
Commit cda1a819 authored by Andrzej Lisak's avatar Andrzej Lisak
Browse files

[ABW]: merge with latest develop

parents 06826c9d aca7a645
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!368New tests
......@@ -27,7 +27,7 @@ BEGIN
__account_id = find_account_id( _account, True );
__start_id = find_account_id( _start, _start <> '' );
IF __start_id <> 0 THEN
SELECT INTO __start_id COALESCE( ( SELECT id FROM hive_follows WHERE following = __account_id AND follower = __start_id ), 0 );
SELECT INTO __start_id ( SELECT id FROM hive_follows WHERE following = __account_id AND follower = __start_id );
END IF;
RETURN QUERY SELECT
ha.name
......@@ -55,7 +55,7 @@ BEGIN
__account_id = find_account_id( _account, True );
__start_id = find_account_id( _start, _start <> '' );
IF __start_id <> 0 THEN
SELECT INTO __start_id COALESCE( ( SELECT id FROM hive_follows WHERE follower = __account_id AND following = __start_id ), 0 );
SELECT INTO __start_id ( SELECT id FROM hive_follows WHERE follower = __account_id AND following = __start_id );
END IF;
RETURN QUERY SELECT
ha.name
......
......@@ -10,20 +10,27 @@ AS
$function$
DECLARE
__post_id INTEGER := 0;
__parent_author_id INTEGER := 0;
BEGIN
IF _permlink <> '' THEN
__post_id = find_comment_id( _author, _permlink, True );
SELECT
ha_pp.name, hp.id
pp.author_id
INTO
_author, __post_id
__parent_author_id
FROM hive_posts hp
JOIN hive_posts pp ON hp.parent_id = pp.id
JOIN hive_accounts ha_pp ON ha_pp.id = pp.author_id
JOIN hive_permlink_data hpd_pp ON hpd_pp.id = pp.permlink_id
JOIN hive_accounts ha ON hp.author_id = ha.id
WHERE
hpd_pp.permlink = _permlink AND ha.name = _author;
WHERE hp.id = __post_id;
ELSE
SELECT
id
INTO
__parent_author_id
FROM hive_accounts
WHERE name = _author;
END IF;
RETURN QUERY SELECT
......@@ -64,15 +71,8 @@ BEGIN
hp.is_pinned,
hp.curator_payout_value
FROM hive_posts_view hp
JOIN
(
SELECT hp.id
FROM hive_posts_view hp
WHERE hp.author = _author
ORDER BY hp.id DESC
LIMIT _limit
) T ON hp.parent_id = T.id
WHERE ( ( __post_id = 0 ) OR ( hp.id <= __post_id ) )
JOIN hive_posts pp ON hp.parent_id = pp.id
WHERE pp.author_id = __parent_author_id AND ( ( __post_id = 0 ) OR ( hp.id <= __post_id ) )
ORDER BY hp.id DESC
LIMIT _limit;
......
Subproject commit f8ac3e6776ef31f23d14a746b6ba6c281382e9cc
Subproject commit 45a18a1ea9617a753a4b1cfac61793247d7adbc8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment