mirror of
https://github.com/friendica/friendica
synced 2025-04-24 11:10:18 +00:00
Remove the obsolete parameter $two_way from terminateFriendship methods
- Follow revokation is now done independently
This commit is contained in:
parent
1047ad7bc2
commit
c4a4473cd0
6 changed files with 18 additions and 26 deletions
|
@ -830,17 +830,17 @@ class Contact
|
|||
* Sends an unfriend message. Removes the contact for two-way unfriending or sharing only protocols (feed an mail)
|
||||
*
|
||||
* @param array $user User unfriending
|
||||
* @param array $contact Contact unfriended
|
||||
* @param array $contact Contact (uid != 0) unfriended
|
||||
* @param boolean $two_way Revoke eventual inbound follow as well
|
||||
* @return bool|null true if successful, false if not, null if no action was performed
|
||||
* @throws HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function terminateFriendship(array $user, array $contact, bool $two_way = false): bool
|
||||
public static function terminateFriendship(array $user, array $contact): bool
|
||||
{
|
||||
$result = Protocol::terminateFriendship($user, $contact, $two_way);
|
||||
$result = Protocol::terminateFriendship($user, $contact);
|
||||
|
||||
if ($two_way || in_array($contact['network'], [Protocol::FEED, Protocol::MAIL])) {
|
||||
if ($contact['rel'] == Contact::SHARING || in_array($contact['network'], [Protocol::FEED, Protocol::MAIL])) {
|
||||
self::remove($contact['id']);
|
||||
} else {
|
||||
self::update(['rel' => Contact::FOLLOWER], ['id' => $contact['id']]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue