]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
if user has private stream flag, set that scope
authorEvan Prodromou <evan@status.net>
Thu, 31 Mar 2011 16:56:53 +0000 (12:56 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 31 Mar 2011 16:56:53 +0000 (12:56 -0400)
classes/Notice.php

index 069d7d64ff3ca7ac05d7759cd5cc5d7e0a53e2b8..1b21819fbd59edbe5845e19d18c69a86c2bcd6f7 100644 (file)
@@ -420,6 +420,18 @@ class Notice extends Memcached_DataObject
             $notice->scope = $scope;
         }
 
+        // For private streams
+
+        $user = $profile->getUser();
+
+        if (!empty($user)) {
+            if ($user->private_stream &&
+                ($notice->scope == Notice::PUBLIC_SCOPE ||
+                 $notice->scope == Notice::SITE_SCOPE)) {
+                $notice->scope |= Notice::FOLLOWER_SCOPE;
+            }
+        }
+
         if (Event::handle('StartNoticeSave', array(&$notice))) {
 
             // XXX: some of these functions write to the DB