Add function sqimap_run_command which combines sending and receiving a
[squirrelmail.git] / functions / imap_general.php
index 1c598fa9415ac412c0f7c2e318c0930a76b26d2a..10d6efe849f2cab993cf21192d370694ce7b0342 100755 (executable)
@@ -33,6 +33,17 @@ function sqimap_session_id() {
     return( $IMAPSessionID );
 }
 
+/******************************************************************************
+** Both send a command and accept the result from the command.  This is
+** to allow proper session number handling.
+******************************************************************************/
+
+function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response, &$message) {
+    fputs ($imap_stream, sqimap_session_id() . $query . "\r\n");
+    $read = sqimap_read_data ($imap_stream, sqimap_session_id(), $handle_errors, $response, $message);
+    return $read;
+}
+
 
 /******************************************************************************
 **  Reads the output from the IMAP stream.  If handle_errors is set to true,