diff options
-rw-r--r-- | TODO | 8 | ||||
-rw-r--r-- | include/services.h | 29 | ||||
-rw-r--r-- | src/protocol/inspircd12.cpp | 13 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 5 |
4 files changed, 6 insertions, 49 deletions
@@ -47,13 +47,7 @@ Legend: [-] Command parser cleanup: mod_current_buffer needs to go away and be replaced by a proper parser. Commands should then indicate how they want the buffer split. [ ] Fix permanent channels support properly. This will require removing do_sjoin(). [ ] Make NS ENFORCE/RELEASE stuff more sane, redo timers -[x] Add support for +k, +q, etc type umodes - Remaining issues: - ? [ ] Also deny kills with usermode +q at Unreal, bearing in mind that AKILL on yourself is prevented that way. - ? [ ] Add a force parameter to SendSVSKill/SendKick. - [ ] No check at modechange yet, maybe it's better to define in what circumstances it shall block, first. - [ ] Check whether there is a similar usermode in other IRCds and add them to the refering protocol. - [ ] Check for blocked KICK in e.g /cs kick. +[ ] Add support for +k, +q, etc type umodes [x] Support operoverride and such things (stop reversing mode changes from nonopped people where unnecessary) - done by Liber 1.9.2 diff --git a/include/services.h b/include/services.h index 663bfaa23..370bdd02f 100644 --- a/include/services.h +++ b/include/services.h @@ -1309,24 +1309,14 @@ private: virtual void SendTopic(BotInfo *, const char *, const char *, const char *, time_t) = 0; virtual void SendVhostDel(User *) { } virtual void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *) = 0; - virtual bool CanSVSKill(const char *source, const char *user, const char *buf) - { - return true; - } - virtual bool SendSVSKill(const char *source, const char *user, const char *fmt, ...) + virtual void SendSVSKill(const char *source, const char *user, const char *fmt, ...) { va_list args; char buf[BUFSIZE] = ""; va_start(args, fmt); vsnprintf(buf, BUFSIZE - 1, fmt, args); va_end(args); - - if (CanSVSKill(source, user, buf)) - { - SendSVSKillInternal(source, user, buf); - } - - return false; + SendSVSKillInternal(source, user, buf); } virtual void SendSVSMode(User *, int, const char **) = 0; virtual void SendMode(BotInfo *bi, const char *dest, const char *fmt, ...) @@ -1339,25 +1329,14 @@ private: SendModeInternal(bi, dest, buf); } virtual void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *, const char *uid) = 0; - virtual bool CanKick(BotInfo *bi, const char *chan, const char *user, const char *buf) - { - return true; - } - virtual bool SendKick(BotInfo *bi, const char *chan, const char *user, const char *fmt, ...) + virtual void SendKick(BotInfo *bi, const char *chan, const char *user, const char *fmt, ...) { va_list args; char buf[BUFSIZE] = ""; va_start(args, fmt); vsnprintf(buf, BUFSIZE - 1, fmt, args); va_end(args); - - if (CanKick(bi, chan, user, buf)) - { - SendKickInternal(bi, chan, user, buf); - return true; - } - - return false; + SendKickInternal(bi, chan, user, buf); } virtual void SendNoticeChanops(BotInfo *bi, const char *dest, const char *fmt, ...) { diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 350ac8ee2..3d5efaaed 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -23,7 +23,6 @@ #define UMODE_r 0x00000010 #define UMODE_w 0x00000020 #define UMODE_A 0x00000040 -#define UMODE_k 0x00000080 #define UMODE_g 0x80000000 #define UMODE_x 0x40000000 @@ -197,7 +196,7 @@ unsigned long umodes[128] = { 0, 0, 0, 0, 0, 0, UMODE_a, 0, 0, 0, 0, 0, UMODE_g, - UMODE_h, UMODE_i, 0, UMODE_k, 0, 0, 0, UMODE_o, + UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o, 0, 0, UMODE_r, 0, 0, 0, 0, UMODE_w, UMODE_x, @@ -510,11 +509,6 @@ class InspIRCdProto : public IRCDProto send_cmd(ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, static_cast<long int>(when), static_cast<long int>(timeleft), reason); } - void CanSVSKill(const char *source, const char *user, const char *buf) - { - return !user->mode & UMODE_k; - } - void SendSVSKillInternal(const char *source, const char *user, const char *buf) { BotInfo *bi = findbot(source); @@ -549,11 +543,6 @@ class InspIRCdProto : public IRCDProto send_cmd(ServerName, "UID %s %ld %s %s %s %s 0.0.0.0 %ld +%s :%s", uid, static_cast<long>(time(NULL)), nick, host, host, user, static_cast<long>(time(NULL)), modes, real); } - bool CanKick(BotInfo *source, const char *chan, const char *user, const char *buf) - { - return !user->mode & UMODE_k; - } - void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf) { User *u = finduser(user); diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 02721c09f..e76aa427a 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -663,11 +663,6 @@ class UnrealIRCdProto : public IRCDProto SendSQLine(nick, "Reserved for services"); } - bool CanKick(BotInfo *source, const char *chan, const char *user, const char *buf) - { - return !user->mode & MODE_q; - } - void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf) { if (buf) send_cmd(source->nick, "H %s %s :%s", chan, user, buf); |