mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-08-29 15:02:15 +00:00
remove self-unfollowing feature
This commit is contained in:
parent
928fe02fa9
commit
57a86d9794
@ -7,13 +7,25 @@ $response = [
|
|||||||
|
|
||||||
if (isset($_SESSION['userName']) && isset($_POST['userName'])) {
|
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 = [
|
$response = [
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => _('Unfollowed successfully'),
|
'message' => _('Unfollowed successfully'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$response = [
|
||||||
|
'success' => false,
|
||||||
|
'message' => _("Can't unfollow yourself"),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user