summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/extern.h2
-rw-r--r--include/services.h5
-rw-r--r--modules/core/bs_help.cpp2
-rw-r--r--modules/core/cs_unban.cpp2
-rw-r--r--modules/protocol/bahamut.cpp7
-rw-r--r--modules/protocol/inspircd11.cpp1
-rw-r--r--modules/protocol/inspircd12.cpp1
-rw-r--r--modules/protocol/inspircd20.cpp1
-rw-r--r--modules/protocol/plexus.cpp1
-rw-r--r--modules/protocol/ratbox.cpp1
-rw-r--r--modules/protocol/unreal32.cpp7
-rw-r--r--src/actions.cpp20
-rw-r--r--src/channels.cpp37
-rw-r--r--src/dns.cpp1
-rw-r--r--src/language.cpp4
15 files changed, 40 insertions, 52 deletions
diff --git a/include/extern.h b/include/extern.h
index c30914c9e..59d0c238e 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -29,7 +29,7 @@ E IRCdMessage *ircdmessage;
E void kill_user(const Anope::string &source, User *user, const Anope::string &reason);
E bool bad_password(User *u);
-E void common_unban(ChannelInfo *ci, User *u);
+E void common_unban(ChannelInfo *ci, User *u, bool full = false);
E BotInfo *BotServ;
E BotInfo *ChanServ;
diff --git a/include/services.h b/include/services.h
index 75aa4905c..645afc911 100644
--- a/include/services.h
+++ b/include/services.h
@@ -441,7 +441,6 @@ struct IRCDVar
int join2msg; /* Join 2 Message */
int chansqline; /* Supports Channel Sqlines */
int quitonkill; /* IRCD sends QUIT when kill */
- int svsmode_unban; /* svsmode can be used to unban */
int vident; /* Supports vidents */
int svshold; /* Supports svshold */
int tsonmode; /* Timestamp on mode changes */
@@ -786,9 +785,10 @@ class Entry : public Flags<EntryType>
/** Check if this entry matches a user
* @param u The user
+ * @param full True to match against a users real host and IP
* @return true on match
*/
- bool Matches(User *u) const;
+ bool Matches(User *u, bool full = false) const;
};
/*************************************************************************/
@@ -968,7 +968,6 @@ class CoreExport IRCDProto
virtual void SendSZLineDel(const XLine *) { }
virtual void SendSZLine(const XLine *) { }
virtual void SendSGLine(const XLine *) { }
- virtual void SendBanDel(const Channel *, const Anope::string &) { }
virtual void SendSVSModeChan(const Channel *, const Anope::string &, const Anope::string &) { }
virtual void SendUnregisteredNick(const User *) { }
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
diff --git a/modules/core/bs_help.cpp b/modules/core/bs_help.cpp
index 43fb59c92..68169cdc8 100644
--- a/modules/core/bs_help.cpp
+++ b/modules/core/bs_help.cpp
@@ -36,7 +36,7 @@ class CommandBSHelp : public Command
for (CommandMap::const_iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ++it)
if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission)))
it->second->OnServHelp(source);
- source.Reply(BOT_HELP_FOOTER, Config->BSMinUsers);
+ source.Reply(BOT_HELP_FOOTER, Config->BSMinUsers, Config->s_ChanServ.c_str(), Config->BSFantasyCharacter[0]);
}
};
diff --git a/modules/core/cs_unban.cpp b/modules/core/cs_unban.cpp
index df5d2877e..4460d9a9c 100644
--- a/modules/core/cs_unban.cpp
+++ b/modules/core/cs_unban.cpp
@@ -48,7 +48,7 @@ class CommandCSUnban : public Command
return MOD_CONT;
}
- common_unban(ci, u2);
+ common_unban(ci, u2, u == u2);
if (u2 == u)
source.Reply(CHAN_UNBANNED, c->name.c_str());
else
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 0dc409b29..28939c7fb 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -25,7 +25,6 @@ IRCDVar myIrcd[] = {
0, /* Join 2 Message */
1, /* Chan SQlines */
1, /* Quit on Kill */
- 1, /* SVSMODE unban */
0, /* vidents */
1, /* svshold */
1, /* time stamp on mode */
@@ -103,12 +102,6 @@ class BahamutIRCdProto : public IRCDProto
send_cmd(Config->ServerName, "SVSHOLD %s 0", nick.c_str());
}
- /* SVSMODE -b */
- void SendBanDel(const Channel *c, const Anope::string &nick)
- {
- SendSVSModeChan(c, "-b", nick);
- }
-
/* SVSMODE channel modes */
void SendSVSModeChan(const Channel *c, const Anope::string &mode, const Anope::string &nick)
{
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 267ec21f4..42c016a37 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -25,7 +25,6 @@ IRCDVar myIrcd[] = {
1, /* Join 2 Message */
0, /* Chan SQlines */
0, /* Quit on Kill */
- 0, /* SVSMODE unban */
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 7795f5edb..6484c4485 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -31,7 +31,6 @@ IRCDVar myIrcd[] = {
0, /* Join 2 Message */
0, /* Chan SQlines */
0, /* Quit on Kill */
- 0, /* SVSMODE unban */
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 57b4fad84..050a023f3 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -31,7 +31,6 @@ IRCDVar myIrcd[] = {
0, /* Join 2 Message */
0, /* Chan SQlines */
0, /* Quit on Kill */
- 0, /* SVSMODE unban */
1, /* vidents */
1, /* svshold */
0, /* time stamp on mode */
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 459e4d1ca..9dddaebdb 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -25,7 +25,6 @@ IRCDVar myIrcd[] = {
0, /* Join 2 Message */
1, /* Chan SQlines */
0, /* Quit on Kill */
- 0, /* SVSMODE unban */
0, /* vidents */
1, /* svshold */
1, /* time stamp on mode */
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index a1172fa40..914010b98 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -25,7 +25,6 @@ IRCDVar myIrcd[] = {
1, /* Join 2 Message */
1, /* Chan SQlines */
0, /* Quit on Kill */
- 0, /* SVSMODE unban */
0, /* vidents */
0, /* svshold */
0, /* time stamp on mode */
diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp
index bf3d178ce..4c0d79ee2 100644
--- a/modules/protocol/unreal32.cpp
+++ b/modules/protocol/unreal32.cpp
@@ -25,7 +25,6 @@ IRCDVar myIrcd[] = {
0, /* Join 2 Message */
0, /* Chan SQlines */
0, /* Quit on Kill */
- 1, /* SVSMODE unban */
1, /* vidents */
1, /* svshold */
1, /* time stamp on mode */
@@ -301,12 +300,6 @@ class UnrealIRCdProto : public IRCDProto
send_cmd("", "BR + %s :%s", edited_reason.c_str(), x->Mask.c_str());
}
- /* SVSMODE -b */
- void SendBanDel(const Channel *c, const Anope::string &nick)
- {
- SendSVSModeChan(c, "-b", nick);
- }
-
/* SVSMODE channel modes */
void SendSVSModeChan(const Channel *c, const Anope::string &mode, const Anope::string &nick)
diff --git a/src/actions.cpp b/src/actions.cpp
index b583cafae..6df607460 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -67,25 +67,21 @@ void kill_user(const Anope::string &source, User *user, const Anope::string &rea
* Unban the user from a channel
* @param ci channel info for the channel
* @param u The user to unban
+ * @param full True to match against the users real host and IP
* @return void
*/
-void common_unban(ChannelInfo *ci, User *u)
+void common_unban(ChannelInfo *ci, User *u, bool full)
{
if (!u || !ci || !ci->c || !ci->c->HasMode(CMODE_BAN))
return;
- if (ircd->svsmode_unban)
- ircdproto->SendBanDel(ci->c, u->nick);
- else
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = ci->c->GetModeList(CMODE_BAN);
+ for (; bans.first != bans.second;)
{
- std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = ci->c->GetModeList(CMODE_BAN);
- for (; bans.first != bans.second;)
- {
- Entry ban(bans.first->second);
- ++bans.first;
- if (ban.Matches(u))
- ci->c->RemoveMode(NULL, CMODE_BAN, ban.GetMask());
- }
+ Entry ban(bans.first->second);
+ ++bans.first;
+ if (ban.Matches(u, full))
+ ci->c->RemoveMode(NULL, CMODE_BAN, ban.GetMask());
}
}
diff --git a/src/channels.cpp b/src/channels.cpp
index f146c17dd..c8c52f188 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -294,7 +294,10 @@ size_t Channel::HasMode(ChannelModeName Name, const Anope::string &param)
*/
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> Channel::GetModeList(ChannelModeName Name)
{
- return std::make_pair(this->modes.find(Name), this->modes.upper_bound(Name));
+ Channel::ModeList::iterator it = this->modes.find(Name), it_end = it;
+ if (it != this->modes.end())
+ it_end = this->modes.upper_bound(Name);
+ return std::make_pair(it, it_end);
}
/** Set a mode internally on a channel, this is not sent out to the IRCd
@@ -1327,17 +1330,14 @@ const Anope::string Entry::GetMask()
/** Check if this entry matches a user
* @param u The user
+ * @param full True to match against a users real host and IP
* @return true on match
*/
-bool Entry::Matches(User *u) const
+bool Entry::Matches(User *u, bool full) const
{
if (!this->FlagCount())
- return 0;
+ return false;
- Anope::string _nick = u->nick;
- Anope::string _user = u->GetVIdent();
- Anope::string _host = u->GetDisplayedHost();
-
if (this->HasFlag(ENTRYTYPE_CIDR))
{
try
@@ -1347,23 +1347,34 @@ bool Entry::Matches(User *u) const
{
return false;
}
+ /* If we're not matching fully and their displayed host isnt their IP */
+ else if (!full && u->ip.addr() != u->GetDisplayedHost())
+ {
+ return false;
+ }
}
catch (const SocketException &)
{
return false;
}
}
- if (this->HasFlag(ENTRYTYPE_NICK) && (_nick.empty() || !this->nick.equals_ci(_nick)))
+ if (this->HasFlag(ENTRYTYPE_NICK) && !this->nick.equals_ci(u->nick))
return false;
- if (this->HasFlag(ENTRYTYPE_USER) && (_user.empty() || !this->user.equals_ci(_user)))
+ if (this->HasFlag(ENTRYTYPE_USER) && !this->user.equals_ci(u->GetVIdent()) && (!full ||
+ !this->user.equals_ci(u->GetIdent())))
return false;
- if (this->HasFlag(ENTRYTYPE_HOST) && (_host.empty() || !this->host.equals_ci(_host)))
+ if (this->HasFlag(ENTRYTYPE_HOST) && !this->host.equals_ci(u->GetDisplayedHost()) && (!full ||
+ (!this->host.equals_ci(u->host) && !this->host.equals_ci(u->chost) && !this->host.equals_ci(u->vhost) &&
+ (!u->ip() || !this->host.equals_ci(u->ip.addr())))))
return false;
- if (this->HasFlag(ENTRYTYPE_NICK_WILD) && !Anope::Match(_nick, this->nick))
+ if (this->HasFlag(ENTRYTYPE_NICK_WILD) && !Anope::Match(u->nick, this->nick))
return false;
- if (this->HasFlag(ENTRYTYPE_USER_WILD) && !Anope::Match(_user, this->user))
+ if (this->HasFlag(ENTRYTYPE_USER_WILD) && !Anope::Match(u->GetVIdent(), this->user) && (!full ||
+ !Anope::Match(u->GetIdent(), this->user)))
return false;
- if (this->HasFlag(ENTRYTYPE_HOST_WILD) && !Anope::Match(_host, this->host))
+ if (this->HasFlag(ENTRYTYPE_HOST_WILD) && !Anope::Match(u->GetDisplayedHost(), this->host) && (!full ||
+ (!Anope::Match(u->host, this->host) && !Anope::Match(u->chost, this->host) &&
+ !Anope::Match(u->vhost, this->host) && (!u->ip() || !Anope::Match(u->ip.addr(), this->host)))))
return false;
return true;
diff --git a/src/dns.cpp b/src/dns.cpp
index 5bdd2a4eb..b37a0bde6 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -559,7 +559,6 @@ void DNSManager::Tick(time_t now)
for (std::multimap<Anope::string, DNSRecord *>::iterator it = this->cache.begin(), it_next; it != this->cache.end(); it = it_next)
{
- Anope::string host = it->first;
DNSRecord *req = it->second;
it_next = it;
++it_next;
diff --git a/src/language.cpp b/src/language.cpp
index 3e7a3e2f7..13e1675f5 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -4856,7 +4856,9 @@ const char *const language_strings[LANG_STRING_COUNT] = {
"%S HELP command."),
/* BOT_HELP_FOOTER */
_("Bot will join a channel whenever there is at least\n"
- "%d user(s) on it."),
+ "%d user(s) on it. Additionally, all %s commands\n"
+ "can be used if fantasy is enabled by prefixing the command\n"
+ "name with a %c."),
/* BOT_HELP_BOTLIST */
_("Syntax: BOTLIST\n"
" \n"