;;; spam-report.el --- Reporting spam
-;; Copyright (C) 2002-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
;; Author: Ted Zlatanov <tzz@lifelogs.com>
;; Keywords: network, spam, mail, gmane, report
or the gnus-group-spam-exit-processor-report-gmane group/topic parameter
instead."
:type '(radio (const nil)
- (regexp :value "^nntp\+.*:gmane\."))
+ (regexp :value "^nntp\\+.*:gmane\\."))
:group 'spam-report)
(defcustom spam-report-gmane-use-article-number t
"Email address that spam articles are resent to when reporting.
If not set, the user will be prompted to enter a value which will be
saved for future use."
- :type 'string
+ :type '(choice (const :tag "Prompt" nil) string)
:group 'spam-report)
(defvar spam-report-url-ping-temp-agent-function nil
rpt-host
(concat
"/"
- (gnus-replace-in-string
- (gnus-replace-in-string
- (gnus-replace-in-string
- (mail-header-xref (gnus-summary-article-header article))
- "/raw" ":silent")
- "^.*article.gmane.org/" "")
- "/" ":"))))
+ (replace-regexp-in-string
+ "/" ":"
+ (replace-regexp-in-string
+ "^.*article.gmane.org/" ""
+ (replace-regexp-in-string
+ "/raw" ":silent"
+ (mail-header-xref (gnus-summary-article-header article))))))))
(spam-report-gmane-use-article-number
(spam-report-url-ping
rpt-host
(when host
(when (string-equal "permalink.gmane.org" host)
(setq host rpt-host)
- (setq report (gnus-replace-in-string
- report "/\\([0-9]+\\)$" ":\\1")))
+ (setq report (replace-regexp-in-string "/\\([0-9]+\\)$" ":\\1"
+ report)))
(setq url (format "http://%s%s" host report)))
(if (not (and host report url))
(gnus-message
(defcustom spam-report-user-mail-address
(and (stringp user-mail-address)
- (gnus-replace-in-string user-mail-address "@" "<at>"))
+ (replace-regexp-in-string "@" "<at>" user-mail-address))
"Mail address of this user used for spam reports to Gmane.
This is initialized based on `user-mail-address'."
:type '(choice string
80))
(error "Could not open connection to %s" host))
(set-marker (process-mark tcp-connection) (point-min))
- (gnus-set-process-query-on-exit-flag tcp-connection nil)
+ (set-process-query-on-exit-flag tcp-connection nil)
(process-send-string
tcp-connection
(format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n"
(re-search-forward
"http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
(let ((spam-report-gmane-wait
- (zerop (% (mm-line-number-at-pos)
- spam-report-gmane-max-requests))))
+ (zerop (% (line-number-at-pos) spam-report-gmane-max-requests))))
(gnus-message 6 "Reporting %s%s..."
(match-string 1) (match-string 2))
(funcall spam-report-url-ping-function
(if (or (eq keep nil)
(and (eq keep 'ask)
(y-or-n-p
- (format
+ (format-message
"Flush requests from `%s'? " (current-buffer)))))
(progn
(gnus-message 7 "Flushing request file `%s'"