summaryrefslogtreecommitdiff
path: root/src/protocol/unreal32.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
commit4996cc4b06c70df801403752e90a7078224beb45 (patch)
tree234fe6aba81ec3e70e7b8e6dfa92250569a0a8bd /src/protocol/unreal32.c
parentc08993be094b5d0427985bee46e4d9d0d2ffbe56 (diff)
Added cmd_akill() function to IRCDProtoNew class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1211 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/unreal32.c')
-rw-r--r--src/protocol/unreal32.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index fc2d1e4e6..5dbee9468 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -529,12 +529,12 @@ void UnrealIRCdProto::cmd_vhost_off(User *u)
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, myIrcd->vhostchar);
}
-void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when,
- time_t expires, const char *reason)
+void UnrealIRCdProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
- send_cmd(NULL, "%s + G %s %s %s %ld %ld :%s", send_token("TKL", "BD"),
- user, host, who, (long int) time(NULL) + 86400 * 2,
- (long int) when, reason);
+ // Calculate the time left before this would expire, capping it at 2 days
+ time_t timeleft = expires - time(NULL);
+ if (timeleft > 172800) timeleft = 172800;
+ send_cmd(NULL, "%s + G %s %s %s %ld %ld :%s", send_token("TKL", "BD"), user, host, who, static_cast<long>(time(NULL) + timeleft), static_cast<long>(when), reason);
}
/*
@@ -2098,7 +2098,6 @@ void moduleAddIRCDMsgs(void) {
**/
void moduleAddAnopeCmds()
{
- pmodule_cmd_akill(unreal_cmd_akill);
pmodule_cmd_svskill(unreal_cmd_svskill);
pmodule_cmd_svsmode(unreal_cmd_svsmode);
pmodule_cmd_372(unreal_cmd_372);