Merge pull request #13375 from MrPetovan/bug/empty-timeline
Fix user moderation conditions in network-thread-view and network-item-view
This commit is contained in:
commit
06a1db4f24
2 changed files with 8 additions and 18 deletions
11
database.sql
11
database.sql
|
@ -2693,14 +2693,12 @@ CREATE VIEW `network-item-view` AS SELECT
|
||||||
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
||||||
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
||||||
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
||||||
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
|
|
||||||
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
|
|
||||||
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
||||||
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
||||||
AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
|
AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
|
||||||
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
||||||
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
|
AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
|
||||||
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`);
|
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- VIEW network-thread-view
|
-- VIEW network-thread-view
|
||||||
|
@ -2723,14 +2721,11 @@ CREATE VIEW `network-thread-view` AS SELECT
|
||||||
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
||||||
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
||||||
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
||||||
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
|
|
||||||
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
|
|
||||||
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
||||||
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
||||||
AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
|
AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
|
||||||
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
||||||
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
|
AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
|
||||||
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)
|
|
||||||
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`);
|
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`);
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
@ -818,14 +818,12 @@
|
||||||
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
||||||
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
||||||
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
||||||
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
|
|
||||||
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
|
|
||||||
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
||||||
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
||||||
AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
|
AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`)
|
||||||
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
||||||
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
|
AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
|
||||||
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)"
|
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`)"
|
||||||
],
|
],
|
||||||
"network-thread-view" => [
|
"network-thread-view" => [
|
||||||
"fields" => [
|
"fields" => [
|
||||||
|
@ -846,14 +844,11 @@
|
||||||
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id`
|
||||||
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id`
|
||||||
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id`
|
||||||
LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id`
|
|
||||||
LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id`
|
|
||||||
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
WHERE `post-user`.`visible` AND NOT `post-user`.`deleted`
|
||||||
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
|
||||||
AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
|
AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`)
|
||||||
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked`
|
||||||
AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`)
|
AND NOT EXISTS(SELECT `cid` FROM `user-contact` WHERE `uid` = `post-thread-user`.`uid` AND `cid` IN (`authorcontact`.`id`, `ownercontact`.`id`) AND (`blocked` OR `ignored`))
|
||||||
AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`)
|
|
||||||
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`)"
|
AND NOT EXISTS(SELECT `gsid` FROM `user-gserver` WHERE `uid` = `post-thread-user`.`uid` AND `gsid` IN (`authorcontact`.`gsid`, `ownercontact`.`gsid`) AND `ignored`)"
|
||||||
],
|
],
|
||||||
"owner-view" => [
|
"owner-view" => [
|
||||||
|
|
Loading…
Reference in a new issue