|
|
|
@ -7,13 +7,25 @@ $response = [
@@ -7,13 +7,25 @@ $response = [
|
|
|
|
|
|
|
|
|
|
if (isset($_SESSION['userName']) && isset($_POST['userName'])) { |
|
|
|
|
|
|
|
|
|
$result = $_twister->unFollow($_SESSION['userName'], [$_POST['userName']]); |
|
|
|
|
$userName = Filter::userName($_POST['userName']); |
|
|
|
|
|
|
|
|
|
if ($_SESSION['userName'] != $userName) { |
|
|
|
|
|
|
|
|
|
$_twister->unFollow($_SESSION['userName'], [$userName]); |
|
|
|
|
|
|
|
|
|
$response = [ |
|
|
|
|
'success' => true, |
|
|
|
|
'message' => _('Unfollowed successfully'), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
$response = [ |
|
|
|
|
'success' => false, |
|
|
|
|
'message' => _("Can't unfollow yourself"), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
$response = [ |
|
|
|
|