mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-16 13:07:46 +02:00
fix(activity-pub): get database records using new model instances
update types and some remap logic
This commit is contained in:
parent
4a28127bc4
commit
92536ddb38
56 changed files with 203 additions and 190 deletions
|
|
@ -39,9 +39,16 @@ class NoteController extends Controller
|
|||
|
||||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (! ($this->note = model('NoteModel')->getNoteById($params[0]))) {
|
||||
if (count($params) < 1) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (($note = model('NoteModel')->getNoteById($params[0])) === null) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$this->note = $note;
|
||||
|
||||
unset($params[0]);
|
||||
|
||||
return $this->{$method}(...$params);
|
||||
|
|
@ -69,7 +76,7 @@ class NoteController extends Controller
|
|||
* get note replies
|
||||
*/
|
||||
$noteReplies = model('NoteModel')
|
||||
->where('in_reply_to_id', service('uuid') ->fromString($this->note->id) ->getBytes(),)
|
||||
->where('in_reply_to_id', service('uuid') ->fromString($this->note->id) ->getBytes())
|
||||
->where('`published_at` <= NOW()', null, false)
|
||||
->orderBy('published_at', 'ASC');
|
||||
|
||||
|
|
@ -252,7 +259,7 @@ class NoteController extends Controller
|
|||
}
|
||||
|
||||
return redirect()->to(
|
||||
str_replace('{uri}', urlencode($this->note->uri), $data->links[$ostatusKey]->template,),
|
||||
str_replace('{uri}', urlencode($this->note->uri), $data->links[$ostatusKey]->template),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue