mirror of
https://github.com/friendica/friendica
synced 2025-04-27 18:30:12 +00:00
Merge pull request #4459 from annando/unmark-contact
Bugfix and improvements for unmarking potentially archived contacts
This commit is contained in:
commit
41cd5af54f
3 changed files with 21 additions and 27 deletions
|
@ -1084,17 +1084,15 @@ class Item extends BaseObject
|
|||
private static function updateContact($arr)
|
||||
{
|
||||
// Unarchive the author
|
||||
$contact = dba::selectFirst('contact', [], ['id' => $arr["author-link"]]);
|
||||
if ($contact['term-date'] > NULL_DATE) {
|
||||
Contact::unmarkForArchival($contact);
|
||||
$contact = dba::selectFirst('contact', [], ['id' => $arr["author-id"]]);
|
||||
if (DBM::is_result($contact)) {
|
||||
Contact::unmarkForArchival($contact);
|
||||
}
|
||||
|
||||
// Unarchive the contact if it is a toplevel posting
|
||||
if ($arr["parent-uri"] === $arr["uri"]) {
|
||||
$contact = dba::selectFirst('contact', [], ['id' => $arr["contact-id"]]);
|
||||
if ($contact['term-date'] > NULL_DATE) {
|
||||
Contact::unmarkForArchival($contact);
|
||||
}
|
||||
// Unarchive the contact if it's not our own contact
|
||||
$contact = dba::selectFirst('contact', [], ['id' => $arr["contact-id"], 'self' => false]);
|
||||
if (DBM::is_result($contact)) {
|
||||
Contact::unmarkForArchival($contact);
|
||||
}
|
||||
|
||||
$update = (!$arr['private'] && (($arr["author-link"] === $arr["owner-link"]) || ($arr["parent-uri"] === $arr["uri"])));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue