[srvx-commits] CVS: services/src chanserv.c,1.309,1.310
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-11-22 04:07:12
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv500/src
Modified Files:
chanserv.c
Log Message:
add back the !invite command
change !suspend/!unsuspend to !adduser/!deluser access level
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.309
retrieving revision 1.310
diff -C2 -r1.309 -r1.310
*** chanserv.c 22 Nov 2002 02:20:35 -0000 1.309
--- chanserv.c 22 Nov 2002 04:07:08 -0000 1.310
***************
*** 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_LOW_CHANNEL_ACCESS "You lack sufficient access in %s to use this command."
--- 237,245 ----
#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_YOU_ALREADY_PRESENT "You are already in $b%s$b."
#define CSMSG_LOW_CHANNEL_ACCESS "You lack sufficient access in %s to use this command."
***************
*** 272,276 ****
#define CSMSG_BAD_MAX_LENGTH "$b%s$b is not a valid maximum length (must be between 20 and 450 inclusive)."
#define CSMSG_NOTE_MODIFIED "Note type $b%s$b modified."
! #define CSMSG_NOTE_CREATED "Note type $b%s$b deleted."
#define CSMSG_NOTE_TYPE_USED "Note type $b%s$b is in use; give the FORCE argument to delete it."
#define CSMSG_NOTE_DELETED "Note type $b%s$b deleted."
--- 276,280 ----
#define CSMSG_BAD_MAX_LENGTH "$b%s$b is not a valid maximum length (must be between 20 and 450 inclusive)."
#define CSMSG_NOTE_MODIFIED "Note type $b%s$b modified."
! #define CSMSG_NOTE_CREATED "Note type $b%s$b created."
#define CSMSG_NOTE_TYPE_USED "Note type $b%s$b is in use; give the FORCE argument to delete it."
#define CSMSG_NOTE_DELETED "Note type $b%s$b deleted."
***************
*** 3937,3940 ****
--- 3941,3985 ----
}
+ static CHANSERV_FUNC(cmd_invite)
+ {
+ struct userData *uData;
+ struct userNode *invite;
+
+ uData = GetChannelUser(channel->channel_info, user->handle_info);
+
+ if(argc > 1)
+ {
+ 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;
+ }
+
static CHANSERV_FUNC(cmd_inviteme)
{
***************
*** 3943,3947 ****
if(GetUserMode(channel, user))
{
! reply(CSMSG_ALREADY_PRESENT, channel->name);
return 0;
}
--- 3988,3992 ----
if(GetUserMode(channel, user))
{
! reply(CSMSG_YOU_ALREADY_PRESENT, channel->name);
return 0;
}
***************
*** 7149,7152 ****
--- 7194,7199 ----
DEFINE_COMMAND(adduser, 3, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL);
DEFINE_COMMAND(deluser, 2, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL);
+ DEFINE_COMMAND(suspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL);
+ DEFINE_COMMAND(unsuspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL);
DEFINE_COMMAND(mdelowner, 2, MODCMD_REQUIRE_CHANUSER, "flags", "+helping", NULL);
***************
*** 7180,7183 ****
--- 7227,7231 ----
DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
DEFINE_COMMAND(inviteme, 1, MODCMD_REQUIRE_CHANNEL, "access", "peon", NULL);
+ DEFINE_COMMAND(invite, 1, MODCMD_REQUIRE_CHANNEL, "access", "master", NULL);
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
***************
*** 7189,7194 ****
DEFINE_COMMAND(delban, 2, MODCMD_REQUIRE_REGCHAN, "access", "master", NULL);
DEFINE_COMMAND(uset, 1, MODCMD_REQUIRE_CHANUSER, "access", "peon", NULL);
- DEFINE_COMMAND(suspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
- DEFINE_COMMAND(unsuspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
DEFINE_COMMAND(bans, 1, MODCMD_REQUIRE_REGCHAN, "access", "peon", "flags", "+nolog", NULL);
--- 7237,7240 ----
|