+
+ /**
+ * Switches a contact to AP if needed
+ *
+ * @param integer $cid Contact ID
+ */
+ private static function switchContact($cid)
+ {
+ $contact = DBA::selectFirst('contact', ['network'], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]);
+ if (!DBA::isResult($contact) || ($contact['network'] == Protocol::ACTIVITYPUB)) {
+ return;
+ }
+
+ logger('Change existing contact ' . $cid . ' from ' . $contact['network'] . ' to ActivityPub.');
+ Contact::updateFromProbe($cid, Protocol::ACTIVITYPUB);
+ }