mirror of
https://github.com/friendica/friendica
synced 2025-04-27 07:50:10 +00:00
Don't archive "self" contacts
This commit is contained in:
parent
a4451c7c3d
commit
e5c2b7a243
2 changed files with 12 additions and 4 deletions
|
@ -141,8 +141,8 @@ class Contact extends BaseObject
|
|||
*/
|
||||
public static function markForArchival(array $contact)
|
||||
{
|
||||
// Contact already archived, nothing to do
|
||||
if ($contact['archive']) {
|
||||
// Contact already archived or "self" contact? => nothing to do
|
||||
if ($contact['archive'] || $contact['self']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ class Contact extends BaseObject
|
|||
dba::update('contact', array('term-date' => datetime_convert()), array('id' => $contact['id']));
|
||||
|
||||
if ($contact['url'] != '') {
|
||||
dba::update('contact', array('term-date' => datetime_convert()), array('`nurl` = ? AND `term-date` <= ?', normalise_link($contact['url']), NULL_DATE));
|
||||
dba::update('contact', array('term-date' => datetime_convert()), array('`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE));
|
||||
}
|
||||
} else {
|
||||
/* @todo
|
||||
|
@ -169,7 +169,7 @@ class Contact extends BaseObject
|
|||
dba::update('contact', array('archive' => 1), array('id' => $contact['id']));
|
||||
|
||||
if ($contact['url'] != '') {
|
||||
dba::update('contact', array('archive' => 1), array('nurl' => normalise_link($contact['url'])));
|
||||
dba::update('contact', array('archive' => 1), array('nurl' => normalise_link($contact['url']), 'self' => false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue