mirror of
https://github.com/anope/anope.git
synced 2026-07-10 05:23:14 +02:00
Add an opertype priv "protected" to not allow services to kick a user.
Also classify ulines as protected
This commit is contained in:
@@ -768,6 +768,7 @@ log
|
||||
* nickserv/confirm - Can confirm other users nicknames
|
||||
* nickserv/drop - Can drop other users nicks
|
||||
* operserv/config - Can modify services's configuration
|
||||
* protected - Can not be kicked from channels by Services
|
||||
*
|
||||
* Available commands:
|
||||
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private
|
||||
|
||||
+1
-1
@@ -323,7 +323,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
/** Check if the user is protected from kicks and negative mode changes
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsProtected() const;
|
||||
bool IsProtected();
|
||||
|
||||
/** Kill a user
|
||||
* @param source The user/server doing the kill
|
||||
|
||||
@@ -1038,8 +1038,8 @@ class BSKick : public Module
|
||||
|
||||
void check_ban(ChannelInfo *ci, User *u, KickerData *kd, int ttbtype)
|
||||
{
|
||||
/* Don't ban ulines */
|
||||
if (u->server->IsULined())
|
||||
/* Don't ban ulines or protected users */
|
||||
if (u->IsProtected())
|
||||
return;
|
||||
|
||||
BanData::Data &bd = this->GetBanData(u, ci->c);
|
||||
@@ -1065,7 +1065,7 @@ class BSKick : public Module
|
||||
va_list args;
|
||||
char buf[1024];
|
||||
|
||||
if (!ci || !ci->bi || !ci->c || !u || u->server->IsULined() || !ci->c->FindUser(u))
|
||||
if (!ci || !ci->bi || !ci->c || !u || u->IsProtected() || !ci->c->FindUser(u))
|
||||
return;
|
||||
|
||||
Anope::string fmt = Language::Translate(u, message);
|
||||
|
||||
+1
-8
@@ -727,11 +727,7 @@ bool Channel::Kick(BotInfo *bi, User *u, const char *reason, ...)
|
||||
vsnprintf(buf, BUFSIZE - 1, reason, args);
|
||||
va_end(args);
|
||||
|
||||
/* May not kick ulines */
|
||||
if (u->server->IsULined())
|
||||
return false;
|
||||
|
||||
/* Do not kick protected clients */
|
||||
/* Do not kick protected clients or Ulines */
|
||||
if (u->IsProtected())
|
||||
return false;
|
||||
|
||||
@@ -863,9 +859,6 @@ bool Channel::CheckKick(User *user)
|
||||
|
||||
/* We don't enforce services restrictions on clients on ulined services
|
||||
* as this will likely lead to kick/rejoin floods. ~ Viper */
|
||||
if (user->server->IsULined())
|
||||
return false;
|
||||
|
||||
if (user->IsProtected())
|
||||
return false;
|
||||
|
||||
|
||||
+2
-5
@@ -642,12 +642,9 @@ ChanUserContainer *User::FindChannel(Channel *c) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool User::IsProtected() const
|
||||
bool User::IsProtected()
|
||||
{
|
||||
if (this->HasMode("PROTECTED") || this->HasMode("GOD"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return this->HasMode("PROTECTED") || this->HasMode("GOD") || this->HasPriv("protected") || (this->server && this->server->IsULined());
|
||||
}
|
||||
|
||||
void User::Kill(const MessageSource &source, const Anope::string &reason)
|
||||
|
||||
Reference in New Issue
Block a user