X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice.php;h=8f4d63c8927a6a4e7e5809c4ea44a65b6b8bba43;hb=0f938ff23479d92113620552eab76b50613c87e3;hp=ebbd9e0462b7e64cb416c1a1eda7c8fd8076885c;hpb=aa5bbdf6e530777ac3e82ec0e7709ccadbb30c35;p=quix0rs-gnu-social.git diff --git a/classes/Notice.php b/classes/Notice.php index ebbd9e0462..8f4d63c892 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -845,7 +845,6 @@ class Notice extends Managed_DataObject // If the original is private to a group, and notice has no group specified, // make it to the same group(s) if (empty($groups) && ($reply->scope & Notice::GROUP_SCOPE)) { - $groups = array(); $replyGroups = $reply->getGroups(); foreach ($replyGroups as $group) { if ($actor->isMember($group)) { @@ -958,11 +957,11 @@ class Notice extends Managed_DataObject // Save per-notice metadata... $mentions = array(); - $groups = array(); + $group_ids = array(); // This event lets plugins filter out non-local recipients (attentions we don't care about) // Used primarily for OStatus (and if we don't federate, all attentions would be local anyway) - Event::handle('GetLocalAttentions', array($actor, $act->context->attention, &$mentions, &$groups)); + Event::handle('GetLocalAttentions', array($actor, $act->context->attention, &$mentions, &$group_ids)); if (!empty($mentions)) { $stored->saveKnownReplies($mentions); @@ -980,7 +979,7 @@ class Notice extends Managed_DataObject // to avoid errors on duplicates. // Note: groups should always be set. - $stored->saveKnownGroups($groups); + $stored->saveKnownGroups($group_ids); if (!empty($urls)) { $stored->saveKnownUrls($urls); @@ -1505,13 +1504,8 @@ class Notice extends Managed_DataObject * best with generalizations on user_group to support * remote groups better. */ - function saveKnownGroups($group_ids) + function saveKnownGroups(array $group_ids) { - if (!is_array($group_ids)) { - // TRANS: Server exception thrown when no array is provided to the method saveKnownGroups(). - throw new ServerException(_('Bad type provided to saveKnownGroups.')); - } - $groups = array(); foreach (array_unique($group_ids) as $id) { $group = User_group::getKV('id', $id);