]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Suggestions.php
Issue 12266: APISuggestions should now work
[friendica.git] / src / Module / Api / Mastodon / Suggestions.php
index bda78becf15e2afc8ea39fdde66dd369a86a0a17..6eb2509269cd33c625a9114a592fbec7d1ff90c9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -39,16 +39,19 @@ class Suggestions extends BaseApi
                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']);
 
                $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);