Relationship Graph View Issue Dependency Graph
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0015490phpList 3 plugins[All Projects] Generalpublic06-02-19 11:34
Reporteradrian15 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Summary0015490: iWantToProcess function
DescriptioniWantToProcess function is a new plugin function that makes possible that a plugin decides on handling or not a message at all. This is independent of the fact is the plugin can send or not this message. (canSend function).

iWantToProcess function is verified several times in sendemaillib.php file.
Additional InformationBased on svn revision 1703.
TagsNo tags attached.

Activities

27-05-10 18:21

 

G02_added_iWantToProcess_function.patch (4,816 bytes)
diff -urN rssfixes_G01_hidden_database_error_editlist/lists/admin/defaultplugin.php rssfixes_G02_added_iWantToProcess_function/lists/admin/defaultplugin.php
--- rssfixes_G01_hidden_database_error_editlist/lists/admin/defaultplugin.php	2010-05-16 17:49:52.000000000 +0200
+++ rssfixes_G02_added_iWantToProcess_function/lists/admin/defaultplugin.php	2010-05-17 06:10:41.000000000 +0200
@@ -63,6 +63,10 @@
     return null;
   }
 
+  function iWantToProcess($messagedata, $userdata) {
+    # Returns if the plugin want to process or not the message in order to send it
+    return true;
+  }
   function writeConfig($name, $value) {
     #  write a value to the general config to be retrieved at a later stage
     # parameters: name -> name of the variable
diff -urN rssfixes_G01_hidden_database_error_editlist/lists/admin/sendemaillib.php rssfixes_G02_added_iWantToProcess_function/lists/admin/sendemaillib.php
--- rssfixes_G01_hidden_database_error_editlist/lists/admin/sendemaillib.php	2010-05-16 17:49:52.000000000 +0200
+++ rssfixes_G02_added_iWantToProcess_function/lists/admin/sendemaillib.php	2010-05-17 06:41:21.000000000 +0200
@@ -507,6 +507,7 @@
   }
 
   foreach ($GLOBALS['plugins'] as $plugin) {
+   if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
     $textmessage = $plugin->parseOutgoingTextMessage($messageid,$textmessage,$destinationemail, $userdata);
     $htmlmessage = $plugin->parseOutgoingHTMLMessage($messageid,$htmlmessage,$destinationemail, $userdata);
     $plugin_attachments = $plugin->getMessageAttachment($messageid,$mail->Body);
@@ -517,6 +518,7 @@
             $plugin_attachment["mimetype"]);
       }
     }
+   }
   }
 
   # this should move into a plugin
@@ -771,7 +773,9 @@
       } else {
         Sql_Query("update {$GLOBALS["tables"]["message"]} set astext = astext + 1 where id = $messageid");
         foreach ($GLOBALS['plugins'] as $plugin) {
-          $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+	  if ($plugin->iWantToProcess($message,$userdata)) {
+            $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          }
         }
         $mail->add_text($textmessage);
         addAttachments($messageid,$mail,"text");
@@ -780,7 +784,9 @@
     case "PDF":
       # send a PDF file to users who want html and text to everyone else
       foreach ($GLOBALS['plugins'] as $plugin) {
-        $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
+            $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          }
       }
       if ($htmlpref) {
         Sql_Query("update {$GLOBALS["tables"]["message"]} set aspdf = aspdf + 1 where id = $messageid");
@@ -816,7 +822,9 @@
       break;
     case "text and PDF":
       foreach ($GLOBALS['plugins'] as $plugin) {
-        $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
+            $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          }
       }
       # send a PDF file to users who want html and text to everyone else
       if ($htmlpref) {
@@ -854,7 +862,9 @@
     case "text":
       # send as text
       foreach ($GLOBALS['plugins'] as $plugin) {
+          if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
         $plugin->processSuccesFailure ($messageid, 'astext', $userdata);
+          }
       }
       Sql_Query("update {$GLOBALS["tables"]["message"]} set astext = astext + 1 where id = $messageid");
        $mail->add_text($textmessage);
@@ -877,7 +887,9 @@
         if ($htmlpref) {
           Sql_Query("update {$GLOBALS["tables"]["message"]} set astextandhtml = astextandhtml + 1 where id = $messageid");
         foreach ($GLOBALS['plugins'] as $plugin) {
-          $plugin->processSuccesFailure($messageid, 'ashtml', $userdata);
+          if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
+            $plugin->processSuccesFailure($messageid, 'ashtml', $userdata);
+          }
         }
         #  dbg("Adding HTML ".$cached[$messageid]["templateid"]);
           $mail->add_html($htmlmessage,$textmessage,$cached[$messageid]["templateid"]);
@@ -885,7 +897,9 @@
         } else {
           Sql_Query("update {$GLOBALS["tables"]["message"]} set astext = astext + 1 where id = $messageid");
           foreach ($GLOBALS['plugins'] as $plugin) {
-            $plugin->processSuccesFailure($messageid, 'astext', $userdata);
+            if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
+              $plugin->processSuccesFailure($messageid, 'astext', $userdata);
+	    }
           }
           $mail->add_text($textmessage);
           addAttachments($messageid,$mail,"text");

Issue History

Date Modified Username Field Change
27-05-10 18:21 adrian15 New Issue
27-05-10 18:21 adrian15 File Added: G02_added_iWantToProcess_function.patch
27-05-10 19:05 h2b2 Relationship added child of 0015498
10-05-11 21:57 michiel Project phpList 3 application => rssmanager
06-02-19 11:34 erion Project rssmanager => phpList 3 plugins
06-02-19 11:34 erion Category Plugin API => General