Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv21226/src
Modified Files:
chanserv.c
Log Message:
Implement a new protection setting that punishes non-users for attacking other non-users.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.265
retrieving revision 1.266
diff -C2 -r1.265 -r1.266
*** chanserv.c 5 Aug 2002 03:29:59 -0000 1.265
--- chanserv.c 6 Aug 2002 02:32:38 -0000 1.266
***************
*** 1377,1380 ****
--- 1377,1382 ----
struct userData *cs_victim, *cs_aggressor;
+ /* Don't protect if no one is to be protected, someone is attacking
+ himself, or if the aggressor is an IRC Operator. */
if(protect == 'n' || victim == aggressor || IsOper(aggressor))
{
***************
*** 1382,1387 ****
}
! if(!(cs_victim = GetChannelAccess(channel, victim->handle_info))) return 0;
! if(!(cs_aggressor = GetChannelAccess(channel, aggressor->handle_info))) return 1;
switch(protect)
--- 1384,1409 ----
}
! /* Don't protect if the victim isn't authenticated (because they
! can't be a channel user), unless we are to protect non-users
! also. */
! cs_victim = GetChannelAccess(channel, victim->handle_info);
! if(protect != 'a' && !cs_victim)
! {
! return 0;
! }
!
! /* Protect if the aggressor isn't a user because at this point,
! the aggressor can only be less than or equal to the victim. */
! cs_aggressor = GetChannelAccess(channel, aggressor->handle_info);
! if(!cs_aggressor)
! {
! return 1;
! }
!
! /* If the aggressor was a user, then the victim can't be helped. */
! if(!cs_victim)
! {
! return 0;
! }
switch(protect)
***************
*** 5270,5273 ****
--- 5292,5296 ----
struct valueData values[] =
{
+ {"Non-users and users will be protected from those of equal or lower access.", 'a'},
{"Users will be protected from those of equal or lower access.", 'e'},
{"Users will be protected from those of lower access.", 'l'},
|