From: Joshua Judson Rosen Date: Tue, 19 Jun 2012 03:39:47 +0000 (-0400) Subject: Make the ForceGroup plugin work consistently for notices from remote users. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9844ec76e9f9d593e31d4e7a0078872eab1d47c8;p=quix0rs-gnu-social.git Make the ForceGroup plugin work consistently for notices from remote users. --- diff --git a/plugins/ForceGroup/ForceGroupPlugin.php b/plugins/ForceGroup/ForceGroupPlugin.php index 06d5521d03..626275d6b9 100644 --- a/plugins/ForceGroup/ForceGroupPlugin.php +++ b/plugins/ForceGroup/ForceGroupPlugin.php @@ -52,6 +52,24 @@ class ForceGroupPlugin extends Plugin function onStartNoticeDistribute($notice) { $profile = $notice->getProfile(); + + $isRemote = !(User::staticGet('id', $profile->id)); + if ($isRemote) { + /* + * Notices from remote users on other sites + * will normally not end up here unless they're + * specifically directed here, e.g.: via explicit + * post to a remote (to them) group. But remote + * notices can also be `pulled in' as a result of + * local users subscribing to the remote user; + * from the remote user's perspective, this results + * in group-forcing appearing effectively random. + * So let's be consistent, and just never force + * incoming remote notices into a ForceGroup: + */ + return true; + } + foreach ($this->post as $nickname) { $group = User_group::getForNickname($nickname); if ($group && $profile->isMember($group)) {