From 0efab157c44faf54a6332e5215badfe952852a0a Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 May 2019 10:36:51 +0000 Subject: [PATCH] Reverted storing the protocol at all the time --- src/Model/Contact.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 059a65e57c..3d0b9abfa1 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1344,7 +1344,6 @@ class Contact extends BaseObject 'location' => defaults($data, 'location', ''), 'about' => defaults($data, 'about', ''), 'network' => $data['network'], - 'protocol' => self::getProtocol($data['url'], $data['network']), 'pubkey' => defaults($data, 'pubkey', ''), 'rel' => self::SHARING, 'priority' => defaults($data, 'priority', 0), @@ -1405,7 +1404,7 @@ class Contact extends BaseObject self::updateAvatar($data['photo'], $uid, $contact_id); } - $fields = ['url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date', 'pubkey', 'protocol']; + $fields = ['url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date', 'pubkey']; $contact = DBA::selectFirst('contact', $fields, ['id' => $contact_id]); // This condition should always be true @@ -1418,8 +1417,7 @@ class Contact extends BaseObject 'url' => $data['url'], 'nurl' => Strings::normaliseLink($data['url']), 'name' => $data['name'], - 'nick' => $data['nick'], - 'protocol' => self::getProtocol($data['url'], $data['network'])]; + 'nick' => $data['nick']]; if (!empty($data['keywords'])) { $updated['keywords'] = $data['keywords']; @@ -2129,9 +2127,9 @@ class Contact extends BaseObject return; } // create contact record - q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `protocol`, `rel`, + q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`, `blocked`, `readonly`, `pending`, `writable`) - VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, 1)", + VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, 1)", intval($importer['uid']), DBA::escape(DateTimeFormat::utcNow()), DBA::escape($url), @@ -2140,7 +2138,6 @@ class Contact extends BaseObject DBA::escape($nick), DBA::escape($photo), DBA::escape($network), - DBA::escape($protocol), intval(self::FOLLOWER) ); -- 2.39.5