*/
public static function unmarkForArchival(array $contact)
{
+ // Always unarchive the relay contact entry
+ if (!empty($contact['batch'])) {
+ $fields = ['term-date' => DBA::NULL_DATETIME, 'archive' => false];
+ $condition = ['batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
+ DBA::update('contact', $fields, $condition);
+ }
+
$condition = ['`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], DBA::NULL_DATETIME];
$exists = DBA::exists('contact', $condition);
DBA::update('contact', $fields, ['id' => $contact['id']]);
DBA::update('contact', $fields, ['nurl' => Strings::normaliseLink($contact['url']), 'self' => false]);
GContact::updateFromPublicContactURL($contact['url']);
-
- if (!empty($contact['batch'])) {
- $condition = ['batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
- DBA::update('contact', $fields, $condition);
- }
}
/**