浏览代码

Update Rules\Profile

Add sendPM property.
Visman 4 年之前
父节点
当前提交
ae0954f83a
共有 1 个文件被更改,包括 10 次插入0 次删除
  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;