--- nntp.el.old 2002-12-09 13:22:57.000000000 +0100 +++ nntp.el 2002-12-09 14:35:30.000000000 +0100 @@ -251,6 +251,9 @@ (autoload 'mail-source-read-passwd "mail-source") (autoload 'open-ssl-stream "ssl")) +(defvar nntp-delete-echo nil) + + ;;; Internal functions. @@ -408,17 +411,17 @@ ;; If nothing to wait for, still remove possibly echo'ed commands. ;; We don't have echos if nntp-open-connection-function ;; is `nntp-open-network-stream', so we skip this in that case. - (unless (or wait-for - (equal nntp-open-connection-function - 'nntp-open-network-stream)) - (nntp-accept-response) - (save-excursion - (set-buffer buffer) - (goto-char pos) - (if (looking-at (regexp-quote command)) - (delete-region pos (progn (forward-line 1) - (gnus-point-at-bol)))) - ))) + + (when (and (not wait-for) + nntp-delete-echo) + (nntp-accept-response) + (save-excursion + (set-buffer buffer) + (goto-char pos) + (if (looking-at (regexp-quote command)) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))) + ))) (nnheader-report 'nntp "Couldn't open connection to %s." nntp-address)))) @@ -1031,7 +1034,25 @@ (set-buffer pbuffer) (nntp-read-server-type) (erase-buffer) + (set-buffer nntp-server-buffer) + + ;; Send a No-Op command to recognize if we need to delete local echo + ;; in future. This only makes sense, if we are using a non-direct connection... + + (unless (equal nntp-open-connection-function + 'nntp-open-network-stream) + + (let ((command "MODE READER") + (pos (point))) + (nntp-send-string process command) + (nntp-wait-for process "\n" (current-buffer)) + (goto-char pos) + (when (looking-at (regexp-quote command)) + (setq nntp-delete-echo t) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))))) + (let ((nnheader-callback-function nil)) (run-hooks 'nntp-server-opened-hook) (nntp-send-authinfo t))))