forked from GNUsocial/gnu-social
use pkeyGet() instead of getReplies() checking addressee scope
This commit is contained in:
parent
9a78d70441
commit
02880f5a8c
@ -1371,17 +1371,11 @@ class Notice extends Memcached_DataObject
|
|||||||
*/
|
*/
|
||||||
function getReplyProfiles()
|
function getReplyProfiles()
|
||||||
{
|
{
|
||||||
$ids = $this->getReplies();
|
$ids = $this->getReplies();
|
||||||
$profiles = array();
|
|
||||||
|
|
||||||
foreach ($ids as $id) {
|
|
||||||
$profile = Profile::staticGet('id', $id);
|
|
||||||
if (!empty($profile)) {
|
|
||||||
$profiles[] = $profile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
if ($this->scope & Notice::ADDRESSEE_SCOPE) {
|
||||||
|
|
||||||
// XXX: just query for the single reply
|
$repl = Reply::pkeyGet(array('notice_id' => $this->id,
|
||||||
|
'profile_id' => $profile->id));
|
||||||
$replies = $this->getReplies();
|
|
||||||
|
if (empty($repl)) {
|
||||||
if (!in_array($profile->id, $replies)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user