Index: rules/modules/system.eval.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/system.eval.inc,v
retrieving revision 1.1.2.13
diff -u -p -r1.1.2.13 system.eval.inc
--- rules/modules/system.eval.inc	9 Jul 2010 18:32:30 -0000	1.1.2.13
+++ rules/modules/system.eval.inc	15 Jul 2010 14:02:41 -0000
@@ -12,8 +12,27 @@
 /**
  * Action: Show a drupal message.
  */
-function rules_action_drupal_message($message, $error) {
-  drupal_set_message($message, $error ? 'error' : 'status');
+function rules_action_drupal_message($message, $type, $other, $clean) {
+  rules_action_clean_messages($clean, $type, $other);
+  if ($type == 'other') {
+    $type = $other;
+  }
+  drupal_set_message(filter_xss($message), $type);
+}
+
+/**
+ * Action: Clean drupal messages.
+ */
+function rules_action_clean_messages($clean, $type, $other) {
+  if ($clean == 1) {
+    unset($_SESSION['messages']);
+  }
+  elseif ($clean == 2) {
+    if ($type == 'other') {
+      $type = $other;
+    }
+    unset($_SESSION['messages'][$type]);
+  }
 }
 
 /**
Index: rules/modules/system.rules.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/system.rules.inc,v
retrieving revision 1.1.4.16
diff -u -p -r1.1.4.16 system.rules.inc
--- rules/modules/system.rules.inc	4 Jun 2010 16:55:22 -0000	1.1.4.16
+++ rules/modules/system.rules.inc	15 Jul 2010 14:02:41 -0000
@@ -104,19 +104,53 @@ function rules_system_action_info() {
         'message' => array(
           'type' => 'text',
           'label' => t('Message'),
-          'sanitize' => TRUE,
         ),
-        'error' => array(
-          'type' => 'boolean',
-          'label' => t('Show as error'),
+        'type' => array(
+          'type' => 'text', 
+          'label' => t('Message type'), 
+          'options list' => 'drupal_set_message_message_types',
+          'description' => t('The message type.'),
+        ),
+        'other' => array(
+          'type' => 'text',
+          'label' => t('Other'),
           'optional' => TRUE,
-          'default value' => FALSE,
-          'restriction' => 'input',
         ),
+        'clean' => array(
+          'type' => 'integer',
+          'label' => t('Clean messages'), 
+          'options list' => 'drupal_set_message_clean_options',
+          'description' => t('Should we clean messages ?'),
+        ),  
       ),
       'base' => 'rules_action_drupal_message',
       'access callback' => 'rules_system_integration_access',
     ),
+    'drupal_message_clean' => array(
+      'label' => t('Clean messages'),
+      'group' => t('System'),
+      'parameter' => array(
+        'clean' => array(
+          'type' => 'integer',
+          'label' => t('Clean messages'), 
+          'options list' => 'drupal_set_message_clean_basic_options',
+          'description' => t('Should we clean messages ?'),
+        ),  
+        'type' => array(
+          'type' => 'text', 
+          'label' => t('Message type'), 
+          'options list' => 'drupal_set_message_message_types',
+          'description' => t('The message type.'),
+        ),
+        'other' => array(
+          'type' => 'text',
+          'label' => t('Other'),
+          'optional' => TRUE,
+        ),
+      ),
+      'base' => 'rules_action_clean_messages',
+      'access callback' => 'rules_system_integration_access',
+    ),
     'redirect' => array(
       'label' => t('Page redirect'),
       'group' => t('System'),
@@ -166,6 +200,25 @@ function rules_system_evaluator_info() {
   );
 }
 
+function drupal_set_message_clean_options() {
+    return  array(0 => t('Do not clean')) + drupal_set_message_clean_basic_options();
+}
+
+function drupal_set_message_clean_basic_options() {
+  return array(
+    1 => t('Clean all'),
+    2 => t('Clean selected type')
+  );
+}
+
+function drupal_set_message_message_types() {
+  return array(
+               'status' => t('Status'),
+               'warning' => t('Warning'),
+               'error' => t('Error'),
+               'other' => t('Other'),
+  );
+}
 /**
  * @}
  */
