mirror of
https://github.com/friendica/friendica
synced 2025-04-27 01:10:14 +00:00
Improved block behaviour
This commit is contained in:
parent
7e84699bdd
commit
d867d73a23
18 changed files with 309 additions and 128 deletions
|
@ -1590,11 +1590,15 @@ class Contact
|
|||
*/
|
||||
public static function getPostsFromId(int $cid, int $uid, bool $only_media = false, string $last_created = null): string
|
||||
{
|
||||
$contact = DBA::selectFirst('contact', ['contact-type', 'network'], ['id' => $cid]);
|
||||
$contact = DBA::selectFirst('contact', ['contact-type', 'network', 'name', 'nick'], ['id' => $cid]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (Contact\User::isIsBlocked($cid, $uid)) {
|
||||
return DI::l10n()->t('%s has blocked you', $contact['name'] ?: $contact['nick']);
|
||||
}
|
||||
|
||||
if (empty($contact["network"]) || in_array($contact["network"], Protocol::FEDERATED)) {
|
||||
$condition = ["(`uid` = 0 OR (`uid` = ? AND NOT `global`))", $uid];
|
||||
} else {
|
||||
|
@ -1658,11 +1662,15 @@ class Contact
|
|||
*/
|
||||
public static function getThreadsFromId(int $cid, int $uid, int $update = 0, int $parent = 0, string $last_created = ''): string
|
||||
{
|
||||
$contact = DBA::selectFirst('contact', ['contact-type', 'network'], ['id' => $cid]);
|
||||
$contact = DBA::selectFirst('contact', ['contact-type', 'network', 'name', 'nick'], ['id' => $cid]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (Contact\User::isIsBlocked($cid, $uid)) {
|
||||
return DI::l10n()->t('%s has blocked you', $contact['name'] ?: $contact['nick']);
|
||||
}
|
||||
|
||||
if (empty($contact["network"]) || in_array($contact["network"], Protocol::FEDERATED)) {
|
||||
$condition = ["(`uid` = 0 OR (`uid` = ? AND NOT `global`))", $uid];
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue