mirror of https://github.com/pixelfed/pixelfed.git
Update DirectMessageController, add parental controls support
This commit is contained in:
parent
fd9b5ad443
commit
fe30cd25d1
|
@ -2575,7 +2575,11 @@ class ApiV1Controller extends Controller
|
|||
|
||||
$limit = $request->input('limit', 20);
|
||||
$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') {
|
||||
$dms = DirectMessage::when($scope === 'inbox', function($q, $scope) use($pid) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue