Browse Source

Use user->u_pm_last_post when posting and editing PM

Visman 4 years ago
parent
commit
dc121b3b64
2 changed files with 5 additions and 1 deletions
  1. 3 1
      app/Models/Pages/PM/PMEdit.php
  2. 2 0
      app/Models/Pages/PM/PMPost.php

+ 3 - 1
app/Models/Pages/PM/PMEdit.php

@@ -50,7 +50,7 @@ class PMEdit extends AbstractPM
         $this->c->Lang->load('post');
         $this->c->Lang->load('post');
 
 
         if ('POST' === $method) {
         if ('POST' === $method) {
-            $v = $this->messageValidator(null, 'PMAction', $args, true, $firstPost);
+            $v = $this->messageValidatorPM(null, 'PMAction', $args, true, $firstPost);
 
 
             if (
             if (
                 $v->validation($_POST)
                 $v->validation($_POST)
@@ -110,6 +110,8 @@ class PMEdit extends AbstractPM
         $v = $this->messageValidator($model, $marker, $args, $edit, $first)
         $v = $this->messageValidator($model, $marker, $args, $edit, $first)
             ->addRules([
             ->addRules([
                 'message' => 'required|string:trim|max:65535 bytes|check_message',
                 'message' => 'required|string:trim|max:65535 bytes|check_message',
+            ])->addArguments([
+                'submit.check_timeout' => $this->user->u_pm_last_post,
             ]);
             ]);
 
 
         return $v;
         return $v;

+ 2 - 0
app/Models/Pages/PM/PMPost.php

@@ -195,6 +195,8 @@ class PMPost extends AbstractPM
             ->addRules([
             ->addRules([
                 'archive' => $this->newTopic ? 'string' : 'absent',
                 'archive' => $this->newTopic ? 'string' : 'absent',
                 'message' => 'required|string:trim|max:65535 bytes|check_message',
                 'message' => 'required|string:trim|max:65535 bytes|check_message',
+            ])->addArguments([
+                'submit.check_timeout' => $this->user->u_pm_last_post,
             ]);
             ]);
 
 
         return $v;
         return $v;