Update DirectMessageController, fix autocomplete bug

This commit is contained in:
Daniel Supernault 2021-09-04 03:22:05 -06:00
parent 29d7514a55
commit 0f00be4d98
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -390,7 +390,6 @@ class DirectMessageController extends Controller
$min_id = $request->input('min_id');
$r = Profile::findOrFail($pid);
// $r = Profile::whereNull('domain')->findOrFail($pid);
if($min_id) {
$res = DirectMessage::select('*')
@ -590,13 +589,13 @@ class DirectMessageController extends Controller
{
$this->validate($request, [
'q' => 'required|string|min:2|max:50',
'remote' => 'nullable|boolean',
'remote' => 'nullable',
]);
$q = $request->input('q');
$r = $request->input('remote');
$r = $request->input('remote', false);
if(!Str::of($q)->contains('.')) {
if($r && !Str::of($q)->contains('.')) {
return [];
}