Add feedback :-)
This commit is contained in:
parent
89a085a12c
commit
462f76352e
4 changed files with 16 additions and 10 deletions
|
@ -1461,8 +1461,8 @@ class Database
|
||||||
|
|
||||||
$row = $this->fetchFirst($sql, $condition);
|
$row = $this->fetchFirst($sql, $condition);
|
||||||
|
|
||||||
if (empty($row['count'])) {
|
if (!isset($row['count'])) {
|
||||||
$this->logger->notice('Invalid count.', ['table' => $table, 'expression' => $expression, 'condition' => $condition_string]);
|
$this->logger->notice('Invalid count.', ['table' => $table, 'expression' => $expression, 'condition' => $condition_string, 'callstack' => System::callstack()]);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
// Ensure to always return either a "null" or a numeric value
|
// Ensure to always return either a "null" or a numeric value
|
||||||
|
|
|
@ -2759,7 +2759,7 @@ class Contact
|
||||||
|
|
||||||
public static function removeFollower(array $contact)
|
public static function removeFollower(array $contact)
|
||||||
{
|
{
|
||||||
if (!empty($contact['rel']) && (($contact['rel'] == self::FRIEND) || ($contact['rel'] == self::SHARING))) {
|
if (in_array($contact['rel'] ?? [], [self::FRIEND, self::SHARING])) {
|
||||||
DBA::update('contact', ['rel' => self::SHARING], ['id' => $contact['id']]);
|
DBA::update('contact', ['rel' => self::SHARING], ['id' => $contact['id']]);
|
||||||
} elseif (!empty($contact['id'])) {
|
} elseif (!empty($contact['id'])) {
|
||||||
self::remove($contact['id']);
|
self::remove($contact['id']);
|
||||||
|
|
|
@ -2259,7 +2259,7 @@ class Item
|
||||||
$condition[0] .= " AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY";
|
$condition[0] .= " AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY";
|
||||||
$condition[] = $days;
|
$condition[] = $days;
|
||||||
|
|
||||||
$items = Post::select(['resource-id', 'starred', 'id', 'post-type', 'uid', 'uri-id'], $condition);
|
$items = Post::select(['resource-id', 'starred', 'id', 'post-type', 'uid', 'uri-id', 'post-type'], $condition);
|
||||||
|
|
||||||
if (!DBA::isResult($items)) {
|
if (!DBA::isResult($items)) {
|
||||||
return;
|
return;
|
||||||
|
@ -2292,9 +2292,9 @@ class Item
|
||||||
continue;
|
continue;
|
||||||
} elseif (!$expire_starred && intval($item['starred'])) {
|
} elseif (!$expire_starred && intval($item['starred'])) {
|
||||||
continue;
|
continue;
|
||||||
} elseif (!$expire_notes && (($item['post-type'] ?? null) == self::PT_PERSONAL_NOTE)) {
|
} elseif (!$expire_notes && ($item['post-type'] == self::PT_PERSONAL_NOTE)) {
|
||||||
continue;
|
continue;
|
||||||
} elseif (!$expire_items && (($item['post-type'] ?? null) != self::PT_PERSONAL_NOTE)) {
|
} elseif (!$expire_items && ($item['post-type'] != self::PT_PERSONAL_NOTE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -290,11 +290,17 @@ class Contact extends BaseModule
|
||||||
$contact_id = $data['user'];
|
$contact_id = $data['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'deleted' => false]);
|
if (empty($data)) {
|
||||||
|
$contact = DBA::selectFirst('contact', [], [
|
||||||
|
'id' => $contact_id,
|
||||||
|
'uid' => [0, local_user()],
|
||||||
|
'deleted' => false
|
||||||
|
]);
|
||||||
|
|
||||||
// Don't display contacts that are about to be deleted
|
// Don't display contacts that are about to be deleted
|
||||||
if (DBA::isResult($contact) && !empty($contact['network']) && $contact['network'] == Protocol::PHANTOM) {
|
if (DBA::isResult($contact) && !empty($contact['network']) && $contact['network'] == Protocol::PHANTOM) {
|
||||||
$contact = false;
|
$contact = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue