mirror of
https://github.com/anope/anope.git
synced 2026-07-01 09:46:40 +02:00
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
+2
-3
@@ -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, ...);
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
+8
-12
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+24
-13
@@ -294,7 +294,10 @@ size_t Channel::HasMode(ChannelModeName Name, const Anope::string ¶m)
|
||||
*/
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+3
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user