From 88bb3c9ddb3bd1cd13ba91efb6124c214ebbe861 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 18 Jun 2014 18:29:04 -0700 Subject: reset timestamps when unarchiving a connection --- include/Contact.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/Contact.php') diff --git a/include/Contact.php b/include/Contact.php index ffee5096a..787612c83 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -133,6 +133,19 @@ function abook_toggle_flag($abook,$flag) { intval($abook['abook_id']), intval($abook['abook_channel']) ); + + // if unsetting the archive bit, update the timestamps so we'll try to connect for an additional 30 days. + + if(($flag === ABOOK_FLAG_ARCHIVED) && ($abook['abook_flags'] & ABOOK_FLAG_ARCHIVED)) { + $r = q("update abook set abook_connected = '%s', abook_updated = '%s' + where abook_id = %d and abook_channel = %d limit 1", + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($abook['abook_id']), + intval($abook['abook_channel']) + ); + } + $a = get_app(); if($a->data['abook']) $a->data['abook']['abook_flags'] = $a->data['abook']['abook_flags'] ^ $flag; -- cgit v1.2.3