]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinementions.php
correctly get profile for scope in apitimelinementions
[quix0rs-gnu-social.git] / actions / apitimelinementions.php
index 2857bd41ea3dc3e4933ed8170d4a3a6e3e7b28f0..2b5053a84f5df0822bafec5454e819abf6d2ccb6 100644 (file)
@@ -178,7 +178,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
             $this->raw($doc->asString());
             break;
         default:
-            // TRANS: Client error displayed when trying to handle an unknown API method.
+            // TRANS: Client error displayed when coming across a non-supported API method.
             $this->clientError(_('API method not found.'), $code = 404);
             break;
         }
@@ -193,10 +193,18 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
     {
         $notices = array();
 
-        $notice = $this->user->getReplies(
-            ($this->page - 1) * $this->count, $this->count,
-            $this->since_id, $this->max_id
-        );
+        if (empty($this->auth_user)) {
+            $profile = null; 
+        } else {
+            $profile = $this->auth_user->getProfile();
+        }
+
+        $stream = new ReplyNoticeStream($this->user->id, $profile);
+
+        $notice = $stream->getNotices(($this->page - 1) * $this->count,
+                                      $this->count,
+                                      $this->since_id,
+                                      $this->max_id);
 
         while ($notice->fetch()) {
             $notices[] = clone($notice);