Scheduled posts can now be created

This commit is contained in:
Michael 2021-07-30 06:22:32 +00:00
parent 4137a6250b
commit bb37c41bd7
2 changed files with 75 additions and 2 deletions

View file

@ -104,7 +104,7 @@ class Statuses extends BaseApi
$item['deny_gid'] = $owner['deny_gid'];
} else {
$item['allow_cid'] = '';
$item['allow_gid'] = [Group::FOLLOWERS];
$item['allow_gid'] = '<' . Group::FOLLOWERS . '>';
$item['deny_cid'] = '';
$item['deny_gid'] = '';
}
@ -183,6 +183,16 @@ class Statuses extends BaseApi
}
}
if (!empty($request['scheduled_at'])) {
$item['guid'] = Item::guid($item, true);
$item['uri'] = Item::newURI($item['uid'], $item['guid']);
$id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, false, $request['scheduled_at']);
if (empty($id)) {
DI::mstdnError()->InternalError();
}
System::jsonExit(DI::mstdnScheduledStatus()->createFromId($id, $uid)->toArray());
}
$id = Item::insert($item, true);
if (!empty($id)) {
$item = Post::selectFirst(['uri-id'], ['id' => $id]);