mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update DirectMessageController, add parental controls support
This commit is contained in:
parent
fd9b5ad443
commit
fe30cd25d1
2 changed files with 867 additions and 837 deletions
|
@ -2575,7 +2575,11 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
$limit = $request->input('limit', 20);
|
$limit = $request->input('limit', 20);
|
||||||
$scope = $request->input('scope', 'inbox');
|
$scope = $request->input('scope', 'inbox');
|
||||||
$pid = $request->user()->profile_id;
|
$user = $request->user();
|
||||||
|
if($user->has_roles && !UserRoleService::can('can-direct-message', $user->id)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
$pid = $user->profile_id;
|
||||||
|
|
||||||
if(config('database.default') == 'pgsql') {
|
if(config('database.default') == 'pgsql') {
|
||||||
$dms = DirectMessage::when($scope === 'inbox', function($q, $scope) use($pid) {
|
$dms = DirectMessage::when($scope === 'inbox', function($q, $scope) use($pid) {
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue