Mercurial > noffle
view control.c @ 38:8e972daaeab9 noffle
[svn] Applied patch from Jim Hague:
- Forget cached group info when group database closed.
- Added list of 'forbidden' newsgroup specs.
- Fixed problem with article numbering if the overview file empties.
- Changed %i to %d in sscanfs (%i interprets leading zeros as octal numbers)
- New groups now always start numbering at article 1.
- Record newsgroup posting status. Enforce it at posting time.
Added --modify
- Added group deletion.
- Added wildmat code taken from INN
author | enz |
---|---|
date | Fri, 05 May 2000 08:23:15 +0100 |
parents | 526a4c34ee2e |
children |
line wrap: on
line source
/* control.c $Id: control.c 32 2000-04-29 14:45:56Z enz $ */ #include "control.h" #include <stdio.h> #include "common.h" #include "content.h" #include "database.h" #include "group.h" #include "itemlist.h" #include "log.h" #include "outgoing.h" int Ctrl_cancel( const char *msgId ) { ItemList *refs; const char *ref; Str server; Bool seen = FALSE; int res = CANCEL_OK; /* See if in outgoing and zap if so. */ if ( Out_find( msgId, server ) ) { Out_remove( server, msgId ); Log_inf( "'%s' cancelled from outgoing queue for '%s'.\n", msgId, server ); seen = TRUE; } if ( ! Db_contains( msgId ) ) { Log_inf( "Cancel: '%s' not in database.", msgId ); return seen ? CANCEL_OK : CANCEL_NO_SUCH_MSG; } /* Retrieve the Xrefs, remove from each group and then remove from the database. */ refs = new_Itl( Db_xref( msgId ), " " ); for( ref = Itl_first( refs ); ref != NULL; ref = Itl_next( refs ) ) { Str grp; int no; if ( sscanf( ref, "%s:%d", grp, &no ) != 2 ) break; if ( Grp_exists( grp ) ) { Cont_read( grp ); Cont_delete( no ); Cont_write(); if ( ! Grp_local( grp ) && ! seen ) res = CANCEL_NEEDS_MSG; Log_dbg( "Removed '%s' from group '%s'.", msgId, grp ); } else { Log_inf( "Group '%s' in Xref for '%s' not found.", grp, msgId ); } } del_Itl( refs ); Db_delete( msgId ); Log_inf( "Message '%s' cancelled.", msgId ); return res; }