summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/bs_assign.cpp30
-rw-r--r--modules/protocol/bahamut.cpp9
-rw-r--r--modules/protocol/charybdis.cpp9
-rw-r--r--modules/protocol/hybrid.cpp9
-rw-r--r--modules/protocol/inspircd11.cpp8
-rw-r--r--modules/protocol/inspircd12.cpp7
-rw-r--r--modules/protocol/inspircd20.cpp7
-rw-r--r--modules/protocol/ngircd.cpp5
-rw-r--r--modules/protocol/plexus.cpp3
-rw-r--r--modules/protocol/ratbox.cpp9
-rw-r--r--modules/protocol/unreal.cpp7
11 files changed, 72 insertions, 31 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp
index 027193f62..bbac6e689 100644
--- a/modules/commands/bs_assign.cpp
+++ b/modules/commands/bs_assign.cpp
@@ -156,7 +156,37 @@ class BSAssign : public Module
BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandbsassign(this), commandbsunassign(this)
{
+ Implementation i[] = { I_OnInvite };
+ ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
+ }
+
+ void OnInvite(User *source, Channel *c, User *targ) anope_override
+ {
+ BotInfo *bi;
+ if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast<BotInfo *>(targ)))
+ return;
+
+ AccessGroup access = c->ci->AccessFor(source);
+ if (c->ci->HasExt("BS_NOBOT") || (!access.HasPriv("ASSIGN") && !source->HasPriv("botserv/administration")))
+ {
+ targ->SendMessage(bi, ACCESS_DENIED);
+ return;
+ }
+
+ if (bi->oper_only && !source->HasPriv("botserv/administration"))
+ {
+ targ->SendMessage(bi, ACCESS_DENIED);
+ return;
+ }
+
+ if (c->ci->bi == bi)
+ {
+ targ->SendMessage(bi, _("Bot \002%s\002 is already assigned to channel \002%s\002."), c->ci->bi->nick.c_str(), c->name.c_str());
+ return;
+ }
+ bi->Assign(source, c->ci);
+ targ->SendMessage(bi, _("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), c->name.c_str());
}
};
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index bebca302b..458602d3b 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -482,6 +482,7 @@ class ProtoBahamut : public Module
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Join message_join;
Message::Kick message_kick;
Message::Kill message_kill;
@@ -544,10 +545,10 @@ class ProtoBahamut : public Module
public:
ProtoBahamut(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_capab(this), message_error(this), message_join(this),
- message_kick(this), message_kill(this), message_motd(this), message_part(this),
- message_ping(this), message_privmsg(this), message_quit(this), message_squit(this),
- message_stats(this), message_time(this), message_version(this), message_whois(this),
+ message_away(this), message_capab(this), message_error(this), message_invite(this),
+ message_join(this), message_kick(this), message_kill(this), message_motd(this),
+ message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
+ message_squit(this), message_stats(this), message_time(this), message_version(this), message_whois(this),
message_burst(this), message_mode(this, "MODE"), message_svsmode(this, "SVSMODE"),
message_nick(this), message_server(this), message_sjoin(this), message_topic(this)
diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp
index f4efbea50..374111f44 100644
--- a/modules/protocol/charybdis.cpp
+++ b/modules/protocol/charybdis.cpp
@@ -324,6 +324,7 @@ class ProtoCharybdis : public Module
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::Mode message_mode;
@@ -384,10 +385,10 @@ class ProtoCharybdis : public Module
public:
ProtoCharybdis(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_capab(this), message_error(this), message_kick(this), message_kill(this),
- message_mode(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
- message_quit(this), message_squit(this), message_stats(this), message_time(this), message_topic(this),
- message_version(this), message_whois(this),
+ message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this),
+ message_kill(this), message_mode(this), message_motd(this), message_part(this), message_ping(this),
+ message_privmsg(this), message_quit(this), message_squit(this), message_stats(this), message_time(this),
+ message_topic(this), message_version(this), message_whois(this),
message_bmask("IRCDMessage", "charybdis/bmask", "ratbox/bmask"),
message_join("IRCDMessage", "charybdis/join", "ratbox/join"),
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index 4953a37cd..a00158bf8 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -522,6 +522,7 @@ class ProtoHybrid : public Module
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::Mode message_mode;
@@ -594,10 +595,10 @@ class ProtoHybrid : public Module
public:
ProtoHybrid(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_capab(this), message_error(this), message_kick(this), message_kill(this),
- message_mode(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
- message_quit(this), message_squit(this), message_stats(this), message_time(this), message_topic(this),
- message_version(this), message_whois(this),
+ message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this),
+ message_kill(this), message_mode(this), message_motd(this), message_part(this), message_ping(this),
+ message_privmsg(this), message_quit(this), message_squit(this), message_stats(this), message_time(this),
+ message_topic(this), message_version(this), message_whois(this),
message_bmask(this), message_eob(this), message_join(this),
message_nick(this), message_pass(this), message_pong(this), message_server(this), message_sid(this),
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 82eb8e31c..eeb1e17e1 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -817,6 +817,7 @@ class ProtoInspIRCd : public Module
/* Core message handlers */
Message::Away message_away;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Join message_join;
Message::Kick message_kick;
Message::Kill message_kill;
@@ -861,9 +862,10 @@ class ProtoInspIRCd : public Module
public:
ProtoInspIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_error(this), message_join(this), message_kick(this), message_kill(this),
- message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
- message_squit(this), message_stats(this), message_time(this), message_topic(this), message_version(this),
+ message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
+ message_kill(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
+ message_quit(this), message_squit(this), message_stats(this), message_time(this), message_topic(this),
+ message_version(this),
message_capab(this), message_chgident(this, "CHGIDENT"), message_setident(this, "SETIDENT"),
message_chgname(this, "CHGNAME"), message_setname(this, "SETNAME"), message_endburst(this),
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 094f514cc..80f21c3da 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -1170,6 +1170,7 @@ class ProtoInspIRCd : public Module
/* Core message handlers */
Message::Away message_away;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Join message_join;
Message::Kick message_kick;
Message::Kill message_kill;
@@ -1205,9 +1206,9 @@ class ProtoInspIRCd : public Module
public:
ProtoInspIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_error(this), message_join(this), message_kick(this), message_kill(this),
- message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
- message_squit(this), message_stats(this), message_topic(this),
+ message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this), message_kill(this),
+ message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this), message_squit(this),
+ message_stats(this), message_topic(this),
message_chgident(this), message_setname(this, "SETNAME"), message_chgname(this, "FNAME"), message_capab(this), message_endburst(this),
message_fhost(this, "FHOST"), message_sethost(this, "SETHOST"), message_fjoin(this), message_fmode(this), message_ftopic(this),
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 6d51c7932..7b21c2b08 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -632,6 +632,7 @@ class ProtoInspIRCd : public Module
/* Core message handlers */
Message::Away message_away;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Join message_join;
Message::Kick message_kick;
Message::Kill message_kill;
@@ -663,9 +664,9 @@ class ProtoInspIRCd : public Module
public:
ProtoInspIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_error(this), message_join(this), message_kick(this), message_kill(this),
- message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
- message_squit(this), message_stats(this), message_topic(this),
+ message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
+ message_kill(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
+ message_quit(this), message_squit(this), message_stats(this), message_topic(this),
message_endburst("IRCDMessage", "inspircd20/endburst", "inspircd12/endburst"),
message_fhost("IRCDMessage", "inspircd20/fhost", "inspircd12/fhost"),
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
index 4f6d75642..c749a2d7d 100644
--- a/modules/protocol/ngircd.cpp
+++ b/modules/protocol/ngircd.cpp
@@ -570,6 +570,7 @@ class ProtongIRCd : public Module
/* Core message handlers */
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::MOTD message_motd;
@@ -643,8 +644,8 @@ class ProtongIRCd : public Module
public:
ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_capab(this), message_error(this), message_kick(this), message_kill(this), message_motd(this),
- message_part(this), message_ping(this), message_privmsg(this), message_squery(this, "SQUERY"),
+ message_capab(this), message_error(this), message_invite(this), message_kick(this), message_kill(this),
+ message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_squery(this, "SQUERY"),
message_quit(this), message_squit(this), message_stats(this), message_time(this), message_version(this),
message_005(this), message_376(this), message_chaninfo(this), message_join(this), message_metadata(this),
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 9af7351ff..b256afc36 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -298,6 +298,7 @@ class ProtoPlexus : public Module
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::Mode message_mode;
@@ -355,7 +356,7 @@ class ProtoPlexus : public Module
public:
ProtoPlexus(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_capab(this), message_error(this), message_kick(this), message_kill(this),
+ message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this), message_kill(this),
message_mode(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
message_squit(this), message_stats(this), message_time(this), message_topic(this), message_version(this), message_whois(this),
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index 1ac129065..2d01605bb 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -185,6 +185,7 @@ class ProtoRatbox : public Module
Message::Away message_away;
Message::Capab message_capab;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Kick message_kick;
Message::Kill message_kill;
Message::Mode message_mode;
@@ -230,10 +231,10 @@ class ProtoRatbox : public Module
public:
ProtoRatbox(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_capab(this), message_error(this), message_kick(this), message_kill(this),
- message_mode(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
- message_quit(this), message_squit(this), message_stats(this), message_time(this), message_topic(this),
- message_version(this), message_whois(this),
+ message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this),
+ message_kill(this), message_mode(this), message_motd(this), message_part(this), message_ping(this),
+ message_privmsg(this), message_quit(this), message_squit(this), message_stats(this), message_time(this),
+ message_topic(this), message_version(this), message_whois(this),
message_bmask("IRCDMessage", "ratbox/bmask", "hybrid/bmask"), message_join("IRCDMessage", "ratbox/join", "hybrid/join"),
message_nick("IRCDMessage", "ratbox/nick", "hybrid/nick"), message_pong("IRCDMessage", "ratbox/pong", "hybrid/pong"),
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index d14927ee1..7a7847972 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -1124,6 +1124,7 @@ class ProtoUnreal : public Module
/* Core message handlers */
Message::Away message_away;
Message::Error message_error;
+ Message::Invite message_invite;
Message::Join message_join;
Message::Kick message_kick;
Message::Kill message_kill;
@@ -1198,9 +1199,9 @@ class ProtoUnreal : public Module
public:
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
- message_away(this), message_error(this), message_join(this), message_kick(this), message_kill(this),
- message_motd(this), message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
- message_squit(this), message_stats(this), message_time(this), message_version(this),
+ message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
+ message_kill(this), message_motd(this), message_part(this), message_ping(this), message_privmsg(this),
+ message_quit(this), message_squit(this), message_stats(this), message_time(this), message_version(this),
message_whois(this),
message_capab(this), message_chghost(this), message_chgident(this), message_chgname(this), message_mode(this, "MODE"),