Gnus development mailing list
 help / color / mirror / Atom feed
From: NAGY Andras <nagya@valerie.inf.elte.hu>
Subject: SOUP and foreign groups
Date: Sat, 31 Jul 1999 16:59:06 GMT	[thread overview]
Message-ID: <87iu70wyfy.fsf@goldfish.telnet.hu> (raw)


Here's a short document describing how to set up SOUP to handle posts
to foreign groups.

I have lots of foreign newsgroups on the server machine, and use SOUP
to transfer news home and read `offline'.  While trying to post to
foreign groups through SOUP I ran into the following problem.

I set gnus-post-method to 'current on the server machine, so posting
to these groups works fine from the server.  However, there's no info
in the SOUP packets whether a group is foreign or not, so reply
packets contain only the `real' group name, no select method prefix
and stuff.  Thus, groups from foreign servers cannot be posted to.

I've found a workaround (or even solution) for this problem, and
wonder if this could be integrated into Gnus.  Anyway, here it goes:

First, I needed a new utility function, currently named
gnus-group-find-prefixed-name, which takes and unprefixed group name
and returns the full prefixed name, as in the group list.  (If there
is more than one group with the same base-name, the first found is
returned.  If there's none, the original name is returned.)

(defun gnus-group-find-prefixed-name (real)
  (let ((alist (cdr gnus-newsrc-alist))
        group)
    (while (and alist (not group))
      (setq full (gnus-info-group (pop alist)))
      (when (string= real (gnus-group-real-name full))
        (setq group full)))
    (or group real)))


Gnus-soup uses Message to send out SOUP replies.  Message uses the
message-post-method variable (either a posting method or a function)
to determine which posting method to use for news.  When posting from
inside Gnus, message-post-method is set locally, so it's original
value is not used.  (Hence setting it to the following value does not
affect the normal behavior of Gnus.)  However, when sending out SOUP
replies, it is.  So we simply set it up to behave as we were posting
from inside Gnus:

(defun my-post-method (arg)
  (gnus-post-method
   arg
   (gnus-group-find-prefixed-name
    (car (split-string (message-fetch-field "newsgroups") "[, ]+")))))

(setq message-post-method 'my-post-method)


Note that we determine the posting method based on the first newsgroup
in the Newsgroups: header.  In most cases, this should be sufficient.
If that group is not found in the server's newsrc, the default posting
method will be used.

We also configure the gnus-post-method function to return the posting
method deducted from the prefixed group name instead of the default
one:

(setq gnus-post-method 'current)


Note that all the configurations above should take place on the server 
machine.  Configuration on the home machine is not required.

I hope this will help others using SOUP.


Andras


                 reply	other threads:[~1999-07-31 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87iu70wyfy.fsf@goldfish.telnet.hu \
    --to=nagya@valerie.inf.elte.hu \
    /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).