]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / classes / Notice.php
index 02b8ce3549f3b79ca4fb6715e6c762a997f87f0e..263cc4e32394ecbcd2880ac2f8cc91e3067a9779 100644 (file)
@@ -2506,16 +2506,12 @@ class Notice extends Managed_DataObject
         // Check default scope (non-private notices)
         $inScope = (!$this->isPrivateScope());
 
-        // Get current user
-        $user = common_current_user();
+        // Get current profile
+        $profile = Profile::current();
 
         // Is the general scope check okay and the user in logged in?
-        /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',user[]=' . gettype($user));
-        if (($inScope === TRUE) && ($user instanceof User)) {
-            // Get profile from it
-            $profile = $user->getProfile();
-            /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',profile[]=' . gettype($profile));
-
+        //* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ',profile[]=' . gettype($profile));
+        if (($inScope === TRUE) && ($profile instanceof Profile)) {
             /*
              * Check scope, else a privacy leaks happens this way:
              *
@@ -2535,7 +2531,7 @@ class Notice extends Managed_DataObject
              * very political words.
              */
             $inScope = $this->inScope($profile);
-            /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ' - After inScope() has been called.');
+            //* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: inScope=' . intval($inScope) . ' - After inScope() has been called.');
         }
 
         $tags = array();