summaryrefslogtreecommitdiff
path: root/src/protocol/bahamut.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/bahamut.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/bahamut.c')
-rw-r--r--src/protocol/bahamut.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index c023340d5..e30e5101d 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -798,11 +798,12 @@ void bahamut_cmd_burst()
* parv[5]=time set
* parv[6]=reason
*/
-void bahamut_cmd_akill(const char *user, const char *host, const char *who, time_t when,
- time_t expires, const char *reason)
+void BahamutIRCdProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
- send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who,
- (long int) time(NULL), 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, "AKILL %s %s %d %s %ld :%s", host, user, timeleft, who, static_cast<long>(time(NULL)), reason);
}
/* SVSKILL */
@@ -1547,7 +1548,6 @@ void bahamut_cmd_chghost(const char *nick, const char *vhost)
**/
void moduleAddAnopeCmds()
{
- pmodule_cmd_akill(bahamut_cmd_akill);
pmodule_cmd_svskill(bahamut_cmd_svskill);
pmodule_cmd_svsmode(bahamut_cmd_svsmode);
pmodule_cmd_372(bahamut_cmd_372);