Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: [spam-report.el] Offline Gmane spam reporting
Date: Thu, 05 Feb 2004 23:07:28 +0100	[thread overview]
Message-ID: <v9d68tuqn3.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <4nr7x9uv4o.fsf@collins.bwh.harvard.edu>

On Thu, Feb 05 2004, Ted Zlatanov wrote:

> On Tue, 03 Feb 2004, 4.uce.03.r.s@nurfuerspam.de wrote:
>> (defun spam-report-process-queue (&optional file keep)
>>   "Report all queued requests from `spam-report-requests-file'.
[...]
>>       (spam-report-url-ping-plain (match-string 1) (match-string 2))
[...]
> I would use spam-report-url-ping-function instead of s-r-u-p-plain
> there, 

Changed to...

  (funcall spam-report-url-ping-function (match-string 1) (match-string 2))

> unless s-r-u-p-function is equal to s-r-u-p-to-file (then we fall
> back to s-r-u-p-plain or maybe alert the user he's doing something
> strange).

Good idea...

  (if (eq spam-report-url-ping-function 'spam-report-url-to-file)
      (error (concat "Cannot process requests when "
		     "`spam-report-url-ping-function' is "
		     "`spam-report-url-to-file'."))
    (gnus-message 7 "Processing requests using `%s'."
		  spam-report-url-ping-function))

I have committed `spam-report-process-queue' now.

BTW: `spam-report-process-queue' calls `spam-report-url-ping-function'
for each report, i.e. when using `spam-report-url-ping-plain', we do
(open-network-stream ...) for each report.  If we always (or often)
have the same host, we could spare some overhead by sending multiple
"GET"s in one connection.  But I don't know if the performance gain is
worth the effort.

>> (add-to-list 'gnus-agent-plugged-hook
>> 	     (lambda ()
>> 	       (setq spam-report-url-ping-function
>> 		     'spam-report-url-ping-plain))
>> 	       (spam-report-process-queue));; see below
>> (add-to-list 'gnus-agent-unplugged-hook
>> 	     (lambda ()
>> 	       (setq spam-report-url-ping-function
>> 		     'spam-report-url-to-file)))
>
> I would save the old spam-report-url-ping-function in the unplugged
> hook, and restore it in the plugged hook, in case the user wants
> something other than 's-r-u-p-plain (they may already have
> 's-r-u-p-to-file for instance!)

If it gets more complicated, I would suggest to define named
functions, because then users may benefit of improvements without
having to edit the lambdas.  Please install what you have in mind (I'm
not sure how you intend to preserve the values and I'm not familiar
with the agent).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




  reply	other threads:[~2004-02-05 22:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-01 14:35 Reiner Steib
2004-02-01 21:39 ` Kai Grossjohann
2004-02-01 23:40   ` Reiner Steib
2004-02-02 14:46     ` Kai Grossjohann
2004-02-02 20:10 ` Ted Zlatanov
2004-02-03 22:59   ` Reiner Steib
2004-02-05 20:30     ` Ted Zlatanov
2004-02-05 22:07       ` Reiner Steib [this message]
2004-02-09 20:51         ` Ted Zlatanov
2004-02-24 14:05           ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9d68tuqn3.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).