mirror of
https://github.com/friendica/friendica
synced 2025-04-27 08:30:10 +00:00
Scheduled posts can now be created
This commit is contained in:
parent
4137a6250b
commit
bb37c41bd7
2 changed files with 75 additions and 2 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue