Gnus development mailing list
 help / color / mirror / Atom feed
* SOUP and foreign groups
@ 1999-07-31 16:59 NAGY Andras
  0 siblings, 0 replies; only message in thread
From: NAGY Andras @ 1999-07-31 16:59 UTC (permalink / 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-07-31 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-31 16:59 SOUP and foreign groups NAGY Andras

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).