From: Evan Prodromou <evan@status.net>
Date: Tue, 2 Aug 2011 15:09:30 +0000 (-0400)
Subject: use pkeyGet() instead of getReplies() checking addressee scope
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=02880f5a8cdab878b94afd30b90fdd922f4af47e;p=quix0rs-gnu-social.git

use pkeyGet() instead of getReplies() checking addressee scope
---

diff --git a/classes/Notice.php b/classes/Notice.php
index d577408fef..952194d43d 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1371,17 +1371,11 @@ class Notice extends Memcached_DataObject
      */
     function getReplyProfiles()
     {
-        $ids      = $this->getReplies();
-        $profiles = array();
-
-        foreach ($ids as $id) {
-            $profile = Profile::staticGet('id', $id);
-            if (!empty($profile)) {
-                $profiles[] = $profile;
-            }
-        }
+        $ids = $this->getReplies();
         
-        return $profiles;
+        $profiles = Profile::multiGet('id', $ids);
+        
+        return $profiles->fetchAll();
     }
 
     /**
@@ -2376,11 +2370,10 @@ class Notice extends Memcached_DataObject
 
         if ($this->scope & Notice::ADDRESSEE_SCOPE) {
 
-            // XXX: just query for the single reply
-
-            $replies = $this->getReplies();
-
-            if (!in_array($profile->id, $replies)) {
+			$repl = Reply::pkeyGet(array('notice_id' => $this->id,
+										 'profile_id' => $profile->id));
+										 
+            if (empty($repl)) {
                 return false;
             }
         }