Browse Source

sqimap_messages_flag and sqimap_messages_remove_flag prepends a '\' char to the supplied flag but the $MDNSent flag should not be prefixed by '\'

Pontus Ullgren 23 years ago
parent
commit
bdba1e955c
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/read_body.php

+ 6 - 5
src/read_body.php

@@ -207,11 +207,12 @@ function SendMDN ( $recipient , $sender) {
 function ToggleMDNflag ( $set ) {
     global $imapConnection, $passed_id, $mailbox;
     sqimap_mailbox_select($imapConnection, $mailbox);
-    if ( $set ) {
-        sqimap_messages_flag ($imapConnection,$passed_id,$passed_id,"\$MDNSent");    
-    } else {
-        sqimap_messages_remove_flag ($imapConnection,$passed_id,$passed_id,"\$MDNSent");    
-    }
+    
+    $sg =  $set?'+':'-';
+    $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)';
+    sqimap_mailbox_select($imapConnection, $mailbox);
+    $read = sqimap_run_command ($imapConnection, $cmd, true, $response, 
+                                $readmessage);
 }
 
 function ClearAttachments() {