X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FContact.php;h=88f588e2f6e4271b898e5111d34d30763953baab;hb=26d7cf1d6a03840bd6645ceb514ee92620a65485;hp=8b575bf122bfba5f8c8cc887e01eeeca65600823;hpb=c2472d9981d4f768325ee69f5db681ce9cedba55;p=friendica.git diff --git a/include/Contact.php b/include/Contact.php index 8b575bf122..88f588e2f6 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -155,7 +155,7 @@ function mark_for_death($contact) { function unmark_for_death($contact) { - $r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND `term-date` > '%s'", + $r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND (`term-date` > '%s' OR `archive`)", intval($contact['id']), dbesc('1000-00-00 00:00:00') ); @@ -166,16 +166,11 @@ function unmark_for_death($contact) { } // It's a miracle. Our dead contact has inexplicably come back to life. - q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d", - dbesc(NULL_DATE), - intval($contact['id']) - ); + $fields = array('term-date' => NULL_DATE, 'archive' => false); + dba::update('contact', $fields, array('id' => $contact['id'])); if ($contact['url'] != '') { - q("UPDATE `contact` SET `term-date` = '%s' WHERE `nurl` = '%s'", - dbesc(NULL_DATE), - dbesc(normalise_link($contact['url'])) - ); + dba::update('contact', $fields, array('nurl' => normalise_link($contact['url']))); } }