return $contact;
}
- public static function newFollower($importer, $contact, $datarray, $item, $sharing = false) {
+ public static function addRelationship($importer, $contact, $datarray, $item, $sharing = false) {
$url = notags(trim($datarray['author-link']));
$name = notags(trim($datarray['author-name']));
$photo = notags(trim($datarray['author-avatar']));
}
}
- public static function loseFollower($importer, $contact, array $datarray = [], $item = "") {
+ public static function removeFollower($importer, $contact, array $datarray = [], $item = "") {
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_SHARING)) {
dba::update('contact', ['rel' => CONTACT_IS_SHARING], ['id' => $contact['id']]);
}
}
- public static function loseSharer($importer, $contact, array $datarray = [], $item = "") {
+ public static function removeSharer($importer, $contact, array $datarray = [], $item = "") {
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_FOLLOWER)) {
dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
// This function once was responsible for DFRN and OStatus.
if (activity_match($item["verb"], ACTIVITY_FOLLOW)) {
logger("New follower");
- Contact::newFollower($importer, $contact, $item, $nickname);
+ Contact::addRelationship($importer, $contact, $item, $nickname);
return false;
}
if (activity_match($item["verb"], ACTIVITY_UNFOLLOW)) {
logger("Lost follower");
- Contact::loseFollower($importer, $contact, $item);
+ Contact::removeFollower($importer, $contact, $item);
return false;
}
if (activity_match($item["verb"], ACTIVITY_REQ_FRIEND)) {
logger("New friend request");
- Contact::newFollower($importer, $contact, $item, $nickname, true);
+ Contact::addRelationship($importer, $contact, $item, $nickname, true);
return false;
}
if (activity_match($item["verb"], ACTIVITY_UNFRIEND)) {
logger("Lost sharer");
- Contact::loseSharer($importer, $contact, $item);
+ Contact::removeSharer($importer, $contact, $item);
return false;
}
} else {
return true;
} else {
logger("Author ".$author." doesn't want to follow us anymore.", LOGGER_DEBUG);
- Contact::loseFollower($importer, $contact);
+ Contact::removeFollower($importer, $contact);
return true;
}
}
}
if ($item["verb"] == ACTIVITY_FOLLOW) {
- Contact::newFollower($importer, $contact, $item, $nickname);
+ Contact::addRelationship($importer, $contact, $item, $nickname);
continue;
}
if ($item["verb"] == NAMESPACE_OSTATUS."/unfollow") {
- Contact::loseFollower($importer, $contact, $item, $dummy);
+ Contact::removeFollower($importer, $contact, $item, $dummy);
continue;
}