* @param array $arr Contains the just posted item record
*/
function item_set_last_item($arr) {
+ $contact = dba::select('contact', [], ['id' => $arr['contact-id']], ['limit' => 1]);
+ if ($contact['term-date'] > NULL_DATE) {
+ Contact::unmarkForArchival($contact);
+ }
$update = (!$arr['private'] && (($arr["author-link"] === $arr["owner-link"]) || ($arr["parent-uri"] === $arr["uri"])));
if ($update) {
dba::update('contact', array('success_update' => $arr['received'], 'last-item' => $arr['received']),
array('id' => $arr['contact-id']));
- $contact = dba::select('contact', [], ['id' => $arr['contact-id']], ['limit' => 1]);
- if ($contact['term-date'] > NULL_DATE) {
- Contact::unmarkForArchival($contact);
- }
}
// Now do the same for the system wide contacts with uid=0
if (!$arr['private']) {
if ($contact['archive']) {
return;
}
-logger('Blubb-m: '.$contact['id'].' - '.System::callstack());
if ($contact['term-date'] <= NULL_DATE) {
dba::update('contact', array('term-date' => datetime_convert()), array('id' => $contact['id']));
*/
public static function unmarkForArchival(array $contact)
{
-//logger('Blubb-m: '.$contact['id'].' - '.System::callstack());
- $condition = array('`id` = ? AND (`term-date` > ? OR `archive`)', $contact[`id`], NULL_DATE);
+ $condition = array('`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], NULL_DATE);
$exists = dba::exists('contact', $condition);
// We don't need to update, we never marked this contact for archival