Browse Source

Update Rules\Profile

Add sendPM property.
Visman 4 years ago
parent
commit
ae0954f83a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      app/Models/Rules/Profile.php

+ 10 - 0
app/Models/Rules/Profile.php

@@ -102,6 +102,16 @@ class Profile extends Rules
         return false;
     }
 
+    protected function getsendPM(): bool
+    {
+        return $this->user->usePM
+            && ! $this->my
+            && (
+                $this->user->isAdmin
+                || $this->curUser->usePM
+            );
+    }
+
     protected function getviewLastVisit(): bool
     {
         return $this->my || $this->user->isAdmMod;