🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Kenneth Herron Mon, 15 Dec 1997 00:00
Another control-article filing patch
#24365
Author: Kenneth Herron
Date: Mon, 15 Dec 1997 00:00
102 lines
3835 bytes
The following patch changes the method for finding a group to file
control articles; instead of trying "control.<word>" followed by
"control", it builds "control.<word>.group.article.was.posted.to" and
then removes name components until it finds something that exists in
the active file.  E.g., given a cancel posted to
alt.sex.fetish.pocket-protectors, inn tries

	control.cancel.alt.sex.fetish.pocket-protectors
	control.cancel.alt.sex.fetish
	control.cancel.alt.sex
	control.cancel.alt
	control.cancel
	control

filing the article in the first group that actually exists.  The group
name used is the first group in the article's newsgroup list that
exists on the local system; if there are none, it uses the group being
created/removed for newgroup/rmgroup messages, otherwise "junk".

Since these are "real" groups, all semantics of real groups are
retained:  You can set expirations, feed the articles, enter & read the
groups, etc.

Let me humbly suggest that you start with at least the following
groups:

	control.cancel.alt
	control.cancel.alt.binaries
	control.cancel.alt.sex
	control.cancel.alt.sex.bondage
	control.cancel.alt.sex.erotica
	control.cancel.alt.sex.fetish
	control.cancel.alt.sex.pictures
	control.cancel.alt.sex.stories
	control.cancel.tw.bbs

The patch is for innd/art.c, version INN 1.7.1 with the insync patches;
as far as I can tell the patch should apply to non-insync source, but
you'll get some complaints about line offsets.

---clip here----
*** art.c	1997/12/15 00:12:20	1.1
--- art.c	1997/12/15 01:15:25
***************
*** 1755,1760 ****
--- 1755,1761 ----
  #if defined(DO_PERL)
      char		*perlrc;
  #endif /* DO_PERL */
+     char		*cgbackup;
  
      /* Preliminary clean-ups. */
      article = &cp->In;
***************
*** 1983,1988 ****
--- 1984,1990 ----
      Approved = *p != '\0';
      ngptr = GroupPointers;
      j = 0;
+     cgbackup = ARTjnk;
      for (GroupMissing = Accepted = FALSE; (p = *groups) != NULL; groups++) {
  	if (!RCcanpost(cp, p))
  	    continue;
***************
*** 1995,2000 ****
--- 1997,2003 ----
  		 * would or would have had the group if it were created. */
  		ARTsendthegroup(*groups);
  		Accepted = TRUE;
+ 		cgbackup = *groups;
  	    }
  	    ARTpoisongroup(*groups);
  
***************
*** 2066,2073 ****
      /* Control messages not filed in "to" get filed only in control.name
       * or control. */
      if (ControlHeader >= 0 && Accepted && !ToGroup) {
! 	FileGlue(buff, "control", '.', ControlWord);
! 	if ((ngp = NGfind(buff)) == NULL)
  	    ngp = NGfind(ARTctl);
  	ngp->PostCount = 0;
  	ngptr = GroupPointers;
--- 2069,2080 ----
      /* Control messages not filed in "to" get filed only in control.name
       * or control. */
      if (ControlHeader >= 0 && Accepted && !ToGroup) {
! 	(void)sprintf(buff, "control.%s.%s", ControlWord,
! 	    (ngptr != GroupPointers ? GroupPointers[0]->Name : cgbackup));
! 	while ((NULL == (ngp = NGfind(buff))) &&
! 	    (NULL != (p = strrchr(buff, '.'))))
! 	    *p = '\0';
! 	if (NULL == ngp)
  	    ngp = NGfind(ARTctl);
  	ngp->PostCount = 0;
  	ngptr = GroupPointers;
---clip here----
-- 
Kenneth Herron      kherron@campus.mci.net      +1 916 649 6142

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads