1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 06:43:14 +02:00

Added cmd_akill() function to IRCDProtoNew class.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1211 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Robin Burchell w00t@inspircd.org
2008-09-30 18:45:10 +00:00
parent c08993be09
commit 4996cc4b06
13 changed files with 29 additions and 55 deletions
-1
View File
@@ -609,7 +609,6 @@ E int servernum;
/**** ircd.c ****/
E void pmodule_ircd_proto(IRCDProtoNew *);
E void pmodule_set_mod_current_buffer(void (*func) (int ac, char **av));
E void pmodule_cmd_akill(void (*func) (const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason));
E void pmodule_cmd_svskill(void (*func) (const char *source, const char *user, const char *buf));
E void pmodule_cmd_svsmode(void (*func) (User * u, int ac, const char **av));
E void pmodule_cmd_372(void (*func) (const char *source, const char *msg));
+1 -1
View File
@@ -1075,7 +1075,6 @@ struct session_ {
**/
typedef struct ircd_proto_ {
void (*ircd_set_mod_current_buffer)(int ac, char **av);
void (*ircd_cmd_akill)(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void (*ircd_cmd_svskill)(const char *source, const char *user, const char *buf);
void (*ircd_cmd_svsmode)(User * u, int ac, const char **av);
void (*ircd_cmd_372)(const char *source, const char *msg);
@@ -1151,6 +1150,7 @@ class IRCDProtoNew {
virtual void cmd_remove_akill(const char *, const char *) = 0;
virtual void cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) = 0;
virtual void cmd_vhost_off(User *) { }
virtual void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *) = 0;
};
typedef struct ircd_modes_ {
+2 -11
View File
@@ -46,7 +46,6 @@ void initIrcdProto()
{
ircdproto.ircd_set_mod_current_buffer = NULL;
ircdproto.ircd_set_umode = NULL;
ircdproto.ircd_cmd_akill = NULL;
ircdproto.ircd_cmd_svskill = NULL;
ircdproto.ircd_cmd_svsmode = NULL;
ircdproto.ircd_cmd_372 = NULL;
@@ -151,10 +150,9 @@ void anope_cmd_vhost_off(User *u)
ircdprotonew->cmd_vhost_off(u);
}
void anope_cmd_akill(const char *user, const char *host, const char *who, time_t when,
time_t expires, const char *reason)
void anope_cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
ircdproto.ircd_cmd_akill(user, host, who, when, expires, reason);
ircdprotonew->cmd_akill(user, host, who, when, expires, reason);
}
void anope_cmd_svskill(const char *source, const char *user, const char *fmt, ...)
@@ -687,13 +685,6 @@ void pmodule_set_mod_current_buffer(void (*func) (int ac, char **av))
ircdproto.ircd_set_mod_current_buffer = func;
}
void pmodule_cmd_akill(void (*func)
(const char *user, const char *host, const char *who, time_t when,
time_t expires, const char *reason))
{
ircdproto.ircd_cmd_akill = func;
}
void
pmodule_cmd_svskill(void (*func) (const char *source, const char *user, const char *buf))
{
+5 -5
View File
@@ -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);
+1 -1
View File
@@ -59,7 +59,6 @@
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
void bahamut_set_umode(User * user, int ac, const char **av);
void bahamut_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void bahamut_cmd_svskill(const char *source, const char *user, const char *buf);
void bahamut_cmd_svsmode(User * u, int ac, const char **av);
void bahamut_cmd_372(const char *source, const char *msg);
@@ -128,4 +127,5 @@ class BahamutIRCdProto : public IRCDProtoNew {
void cmd_svsnoop(const char *, int);
void cmd_remove_akill(const char *, const char *);
void cmd_topic(const char *, const char *, const char *, const char *, time_t);
void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *);
} ircd_proto;
+3 -10
View File
@@ -877,16 +877,10 @@ host: the 'host' portion of the kline
reason: the reason for the kline.
*/
void charybdis_cmd_akill(const char *user, const char *host, const char *who, time_t when,
time_t expires, const char *reason)
void CharybdisProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
Uid *ud;
ud = find_uid(s_OperServ);
send_cmd((UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ),
"KLINE * %ld %s %s :%s",
(long int) (expires - (long) time(NULL)), user, host, reason);
Uid *ud = find_uid(s_OperServ);
send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason);
}
void charybdis_cmd_svskill(const char *source, const char *user, const char *buf)
@@ -1827,7 +1821,6 @@ int charybdis_send_deaccount(int argc, char **argv)
**/
void moduleAddAnopeCmds()
{
pmodule_cmd_akill(charybdis_cmd_akill);
pmodule_cmd_svskill(charybdis_cmd_svskill);
pmodule_cmd_svsmode(charybdis_cmd_svsmode);
pmodule_cmd_372(charybdis_cmd_372);
+1 -1
View File
@@ -47,7 +47,6 @@
void charybdis_set_umode(User * user, int ac, const char **av);
void charybdis_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void charybdis_cmd_svskill(const char *source, const char *user, const char *buf);
void charybdis_cmd_svsmode(User * u, int ac, const char **av);
void charybdis_cmd_372(const char *source, const char *msg);
@@ -116,4 +115,5 @@ class CharybdisProto : public IRCDProtoNew {
void cmd_remove_akill(const char *, const char *);
void cmd_topic(const char *, const char *, const char *, const char *, time_t);
void cmd_vhost_off(User *);
void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *);
} ircd_proto;
+5 -6
View File
@@ -543,12 +543,12 @@ void InspIRCdProto::cmd_vhost_off(User *u)
send_cmd(s_HostServ, "MODE %s -x", u->nick);
}
void
inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,
time_t expires, const char *reason)
void InspIRCdProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
send_cmd(ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who,
(long int) when, (long int) 86400 * 2, 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(ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, static_cast<long>(when), static_cast<long>(timeleft), reason);
}
void inspircd_cmd_svskill(const char *source, const char *user, const char *buf)
@@ -1786,7 +1786,6 @@ void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf)
**/
void moduleAddAnopeCmds()
{
pmodule_cmd_akill(inspircd_cmd_akill);
pmodule_cmd_svskill(inspircd_cmd_svskill);
pmodule_cmd_svsmode(inspircd_cmd_svsmode);
pmodule_cmd_372(inspircd_cmd_372);
+1 -1
View File
@@ -52,7 +52,6 @@
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
void inspircd_set_umode(User * user, int ac, const char **av);
void inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void inspircd_cmd_svskill(const char *source, const char *user, const char *buf);
void inspircd_cmd_svsmode(User * u, int ac, const char **av);
void inspircd_cmd_372(const char *source, const char *msg);
@@ -132,4 +131,5 @@ class InspIRCdProto : public IRCDProtoNew {
void cmd_remove_akill(const char *, const char *);
void cmd_topic(const char *, const char *, const char *, const char *, time_t);
void cmd_vhost_off(User *);
void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *);
} ircd_proto;
+3 -10
View File
@@ -819,16 +819,10 @@ host: the 'host' portion of the kline
reason: the reason for the kline.
*/
void ratbox_cmd_akill(const char *user, const char *host, const char *who, time_t when,
time_t expires, const char *reason)
void RatboxProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
{
Uid *ud;
ud = find_uid(s_OperServ);
send_cmd((UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ),
"KLINE * %ld %s %s :%s",
(long int) (expires - (long) time(NULL)), user, host, reason);
Uid *ud = find_uid(s_OperServ);
send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason);
}
void ratbox_cmd_svskill(const char *source, const char *user, const char *buf)
@@ -1719,7 +1713,6 @@ void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf)
**/
void moduleAddAnopeCmds()
{
pmodule_cmd_akill(ratbox_cmd_akill);
pmodule_cmd_svskill(ratbox_cmd_svskill);
pmodule_cmd_svsmode(ratbox_cmd_svsmode);
pmodule_cmd_372(ratbox_cmd_372);
+1 -1
View File
@@ -46,7 +46,6 @@
void ratbox_set_umode(User * user, int ac, const char **av);
void ratbox_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void ratbox_cmd_svskill(const char *source, const char *user, const char *buf);
void ratbox_cmd_svsmode(User * u, int ac, const char **av);
void ratbox_cmd_372(const char *source, const char *msg);
@@ -114,4 +113,5 @@ class RatboxProto : public IRCDProtoNew {
public:
void cmd_remove_akill(const char *, const char *);
void cmd_topic(const char *, const char *, const char *, const char *, time_t);
void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *);
} ircd_proto;
+5 -6
View File
@@ -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);
+1 -1
View File
@@ -81,7 +81,6 @@
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
void unreal_set_umode(User * user, int ac, const char **av);
void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason);
void unreal_cmd_svskill(const char *source, const char *user, const char *buf);
void unreal_cmd_svsmode(User * u, int ac, const char **av);
void unreal_cmd_372(const char *source, const char *msg);
@@ -151,4 +150,5 @@ class UnrealIRCdProto : public IRCDProtoNew {
void cmd_remove_akill(const char *, const char *);
void cmd_topic(const char *, const char *, const char *, const char *, time_t);
void cmd_vhost_off(User *);
void cmd_akill(const char *, const char *, const char *, time_t, time_t, const char *);
} ircd_proto;