Removed Following (use RSS), allow unix for Redis

This commit is contained in:
Pablo Ferreiro 2022-02-06 14:22:23 +01:00
parent 84023905ff
commit 3772eabd99
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
23 changed files with 144 additions and 205 deletions

View file

@ -3,7 +3,6 @@ namespace App\Controllers;
use App\Helpers\Misc;
use App\Helpers\Cookies;
use App\Helpers\Following;
use App\Models\SettingsTemplate;
class SettingsController {
@ -21,34 +20,4 @@ class SettingsController {
$url = Misc::url('/settings');
header("Location: {$url}");
}
static public function following() {
$following = Following::getUsers();
if (!isset($_POST['mode']) || empty($_POST['mode'])) {
die('You need to send a mode');
}
switch ($_POST['mode']) {
case 'add':
// Add following
array_push($following, $_POST['account']);
break;
case 'remove':
// Remove following
$index = array_search($_POST['account'], $following);
if ($index !== false) {
unset($following[$index]);
}
break;
default:
// Invalid
die('Invalid mode');
}
// Build string
$following_string = implode(',', $following);
Cookies::set('following', $following_string);
$url = Misc::url('/settings');
header("Location: {$url}");
}
}