Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / gnus-fun.el
index 4105a81..473470b 100644 (file)
@@ -239,6 +239,28 @@ colors of the displayed X-Faces."
     (gnus-convert-image-to-gray-x-face (concat file ".gif") 3)
     (delete-file (concat file ".gif"))))
 
+(defun gnus-respond-to-confirmation ()
+  "Respond to a Gmane confirmation message."
+  (interactive)
+  (gnus-summary-show-article 'raw)
+  (set-buffer gnus-article-buffer)
+  (let ((buffer-read-only nil))
+    (goto-char (point-min))
+    (gnus-article-goto-header "Original-To")
+    (replace-match "To:"))
+  (let ((auth nil))
+    (when (and (search-forward "Majordomo" nil t)
+              (re-search-forward "auth.*subscribe.*$" nil t))
+      (setq auth (match-string 0)))
+    (message-wide-reply)
+    (goto-char (point-min))
+    (gnus-article-goto-header "Cc")
+    (replace-match "From:")
+    (message-goto-body)
+    (delete-region (point) (point-max))
+    (when auth
+      (insert auth "\n"))))
+
 (provide 'gnus-fun)
 
 ;;; gnus-fun.el ends here