mirror of
https://github.com/friendica/friendica
synced 2025-04-27 05:50:10 +00:00
Refactor API notification usage
- Remove "mapFields()" from BaseModel - Add new Notification API entity (including collection) - Add new NotificationFactory method "getApiList()"
This commit is contained in:
parent
4a3544582c
commit
582f6bd4a3
9 changed files with 164 additions and 109 deletions
|
@ -5892,10 +5892,11 @@ api_register_func('api/friendica/activity/unattendmaybe', 'api_friendica_activit
|
|||
* Returns notifications
|
||||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
*
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws BadRequestException
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_friendica_notification($type)
|
||||
{
|
||||
|
@ -5908,7 +5909,7 @@ function api_friendica_notification($type)
|
|||
throw new BadRequestException("Invalid argument count");
|
||||
}
|
||||
|
||||
$notifications = DI::notify()->select(['uid' => api_user()], ['order' => ['seen' => 'ASC', 'date' => 'DESC'], 'limit' => 50]);
|
||||
$notifications = DI::notification()->getApiList(local_user());
|
||||
|
||||
if ($type == "xml") {
|
||||
$xmlnotes = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue