diff options
author | friendica <info@friendica.com> | 2014-06-18 18:29:04 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-06-18 18:29:04 -0700 |
commit | 88bb3c9ddb3bd1cd13ba91efb6124c214ebbe861 (patch) | |
tree | c3a5c04673bc4836f356c5526f779414b680fef0 /include | |
parent | ecbbd66e8f69cf44446d7f12f3623b47ff2e64e2 (diff) | |
download | volse-hubzilla-88bb3c9ddb3bd1cd13ba91efb6124c214ebbe861.tar.gz volse-hubzilla-88bb3c9ddb3bd1cd13ba91efb6124c214ebbe861.tar.bz2 volse-hubzilla-88bb3c9ddb3bd1cd13ba91efb6124c214ebbe861.zip |
reset timestamps when unarchiving a connection
Diffstat (limited to 'include')
-rw-r--r-- | include/Contact.php | 13 |
1 files changed, 13 insertions, 0 deletions
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; |