<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function rawContent()
+ protected function rawContent(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
- $request = self::getRequest([
+ $request = $this->getRequest([
'limit' => 40, // Maximum number of results to return. Defaults to 40.
- ]);
+ ], $request);
- $suggestions = Contact\Relation::getSuggestions($uid, 0, $request['limit']);
+ $suggestions = Contact\Relation::getCachedSuggestions($uid, 0, $request['limit']);
$accounts = [];
foreach ($suggestions as $suggestion) {
- $accounts[] = DI::mstdnAccount()->createFromContactId($suggestion['id'], $uid);
+ $accounts[] = [
+ 'source' => 'past_interactions',
+ 'account' => DI::mstdnAccount()->createFromContactId($suggestion['id'], $uid)
+ ];
}
System::jsonExit($accounts);