[srvx-commits] CVS: services/src chanserv.c,1.283,1.284
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-09-16 14:53:43
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv1604/src
Modified Files:
chanserv.c
Log Message:
replace cmd_invite with cmd_inviteme (inviting others was a source of services abuse)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.283
retrieving revision 1.284
diff -C2 -r1.283 -r1.284
*** chanserv.c 15 Sep 2002 00:01:11 -0000 1.283
--- chanserv.c 16 Sep 2002 14:53:35 -0000 1.284
***************
*** 237,244 ****
#define CSMSG_PROCESS_USERS "%s users in $b%s$b."
! #define CSMSG_INVITED_USER "Invited $b%s$b to join %s."
! #define CSMSG_INVITING_YOU "$b%s$b invites you to join %s%s%s"
! #define CSMSG_CANNOT_INVITE "You lack sufficient access to invite users."
! #define CSMSG_ALREADY_PRESENT "%s is $balready in %s$b."
#define CSMSG_KICK_DONE "Kicked $b%s$b from %s."
--- 237,241 ----
#define CSMSG_PROCESS_USERS "%s users in $b%s$b."
! #define CSMSG_ALREADY_PRESENT "You are already in $b%s$b."
#define CSMSG_KICK_DONE "Kicked $b%s$b from %s."
***************
*** 3950,3997 ****
}
! static CHANSERV_FUNC(cmd_invite)
{
! struct userData *uData;
! struct userNode *invite;
!
! uData = GetChannelUser(channel->channel_info, user->handle_info);
!
! if(argc > 1)
! {
! if(uData->access < ulMaster)
! {
! chanserv_notice(user, CSMSG_CANNOT_INVITE);
! return 0;
! }
!
! if(!(invite = GetUserH(argv[1])))
! {
! chanserv_notice(user, MSG_NICK_UNKNOWN, argv[1]);
! return 0;
! }
! }
! else
! {
! invite = user;
! }
!
! if(GetUserMode(channel, invite))
{
! chanserv_notice(user, CSMSG_ALREADY_PRESENT, invite->nick, channel->name);
return 0;
}
!
! if(user != invite)
! {
! char *reason = (argc > 2) ? unsplit_string(argv + 2, argc - 2, NULL) : "";
!
! chanserv_notice(invite, CSMSG_INVITING_YOU, user->nick, channel->name, (argc > 2) ? ": " : ".", reason);
! }
! irc_invite(chanserv, invite, channel);
! if(argc > 1)
! {
! chanserv_notice(user, CSMSG_INVITED_USER, argv[1], channel->name);
! }
!
return 1;
}
--- 3947,3959 ----
}
! static CHANSERV_FUNC(cmd_inviteme)
{
! (void)argv;
! if(GetUserMode(channel, user))
{
! reply(CSMSG_ALREADY_PRESENT, channel->name);
return 0;
}
! irc_invite(cmd->parent->bot, user, channel);
return 1;
}
***************
*** 6955,6959 ****
DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
! DEFINE_COMMAND(invite, 1, MODCMD_REQUIRE_CHANUSER, "access", "peon", NULL);
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
--- 6917,6921 ----
DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
! DEFINE_COMMAND(inviteme, 1, MODCMD_REQUIRE_CHANUSER, "access", "peon", NULL);
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
|