mirror of
https://github.com/friendica/friendica
synced 2025-04-26 19:50:10 +00:00
Display featured posts for contacts
This commit is contained in:
parent
8669f12176
commit
75bc4eccb7
21 changed files with 172 additions and 118 deletions
|
@ -96,7 +96,7 @@ class Statuses extends BaseApi
|
|||
}
|
||||
|
||||
if ($request['pinned']) {
|
||||
$condition = DBA::mergeConditions($condition, ['pinned' => true]);
|
||||
$condition = DBA::mergeConditions($condition, ['featured' => true]);
|
||||
}
|
||||
|
||||
if ($request['exclude_replies']) {
|
||||
|
|
|
@ -46,11 +46,7 @@ class Pin extends BaseApi
|
|||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
|
||||
if ($item['gravity'] != GRAVITY_PARENT) {
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
|
||||
}
|
||||
|
||||
Post\ThreadUser::setPinned($this->parameters['id'], $uid, true);
|
||||
Post\Collection::add($this->parameters['id'], Post\Collection::FEATURED);
|
||||
|
||||
System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
|
||||
}
|
||||
|
|
|
@ -46,11 +46,7 @@ class Unpin extends BaseApi
|
|||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
|
||||
if ($item['gravity'] != GRAVITY_PARENT) {
|
||||
DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Only starting posts can be pinned'));
|
||||
}
|
||||
|
||||
Post\ThreadUser::setPinned($this->parameters['id'], $uid, false);
|
||||
Post\Collection::remove($this->parameters['id'], Post\Collection::FEATURED);
|
||||
|
||||
System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue