From 22429cd432ae99c529040d013b9e25f0549bdf31 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Fri, 17 Sep 2010 16:50:30 -0700 Subject: [PATCH] friends not being correctly unmarked for death after contact resumed --- include/Contact.php | 2 +- include/poller.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/Contact.php b/include/Contact.php index 3c41f76508..c59038e5d7 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -46,7 +46,7 @@ function mark_for_death($contact) { if(! function_exists('unmark_for_death')) { 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 LIMIT 1", + q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d LIMIT 1", dbesc('0000-00-00 00:00:00'), intval($contact['id']) ); diff --git a/include/poller.php b/include/poller.php index f116a56220..0980ca1fa5 100644 --- a/include/poller.php +++ b/include/poller.php @@ -105,12 +105,14 @@ if(intval($res->status) == 1) mark_for_death($contact); + else { + if($contact['term-date'] != '0000-00-00 00:00:00') + unmark_for_death($contact); + } if((intval($res->status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id))) continue; - if($contact['term-date'] != '0000-00-00 00:00:00') - unmark_for_death($contact); $postvars = array();