+ if (empty($contact['uid'])) {
+ throw new \InvalidArgumentException('Unexpected public contact record');
+ }
+
+ $cdata = Contact::getPublicAndUserContactID($contact['id'], $contact['uid']);
+
+ if (in_array($contact['rel'], [self::SHARING, self::FRIEND])) {
+ Worker::add(PRIORITY_HIGH, 'Contact\Unfollow', $cdata['public'], $contact['uid']);
+ }
+
+ if (in_array($contact['rel'], [self::FOLLOWER, self::FRIEND])) {
+ Worker::add(PRIORITY_HIGH, 'Contact\RevokeFollow', $cdata['public'], $contact['uid']);
+ }
+
+ self::remove($contact['id']);