From 7640fad30cc2a3d61e67a7075c27f26400d4779f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Feb 2024 10:16:05 +0000 Subject: Simplify several boolean expressions. --- modules/nickserv/ns_ajoin.cpp | 6 +++--- modules/nickserv/ns_group.cpp | 2 +- modules/nickserv/ns_recover.cpp | 2 +- modules/nickserv/ns_register.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/nickserv') diff --git a/modules/nickserv/ns_ajoin.cpp b/modules/nickserv/ns_ajoin.cpp index 19355f861..a21f66fd0 100644 --- a/modules/nickserv/ns_ajoin.cpp +++ b/modules/nickserv/ns_ajoin.cpp @@ -146,7 +146,7 @@ class CommandNSAJoin final } else if (i != (*channels)->size()) alreadyadded += chan + ", "; - else if (IRCD->IsChannelValid(chan) == false) + else if (!IRCD->IsChannelValid(chan)) source.Reply(CHAN_X_INVALID, chan.c_str()); else { @@ -361,9 +361,9 @@ public: continue; else if (c->HasMode("SSL") && !u->IsSecurelyConnected()) continue; - else if (c->MatchesList(u, "BAN") == true && c->MatchesList(u, "EXCEPT") == false) + else if (c->MatchesList(u, "BAN") && !c->MatchesList(u, "EXCEPT")) need_invite = true; - else if (c->HasMode("INVITE") && c->MatchesList(u, "INVITEOVERRIDE") == false) + else if (c->HasMode("INVITE") && !c->MatchesList(u, "INVITEOVERRIDE")) need_invite = true; if (c->HasMode("KEY")) diff --git a/modules/nickserv/ns_group.cpp b/modules/nickserv/ns_group.cpp index 3afec1061..58ded41b4 100644 --- a/modules/nickserv/ns_group.cpp +++ b/modules/nickserv/ns_group.cpp @@ -178,7 +178,7 @@ public: if (user != NULL && !user->fingerprint.empty() && cl && cl->FindCert(user->fingerprint)) ok = true; - if (ok == false && !pass.empty()) + if (!ok && !pass.empty()) { auto *req = new NSGroupRequest(owner, source, this, source.GetNick(), target, pass); FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req)); diff --git a/modules/nickserv/ns_recover.cpp b/modules/nickserv/ns_recover.cpp index 7460dbd33..f12929f3a 100644 --- a/modules/nickserv/ns_recover.cpp +++ b/modules/nickserv/ns_recover.cpp @@ -192,7 +192,7 @@ public: if (source.HasPriv("nickserv/recover")) ok = true; - if (ok == false && !pass.empty()) + if (!ok && !pass.empty()) { auto *req = new NSRecoverRequest(owner, source, this, na->nick, pass); FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req)); diff --git a/modules/nickserv/ns_register.cpp b/modules/nickserv/ns_register.cpp index 5ee5fccb2..34a76d973 100644 --- a/modules/nickserv/ns_register.cpp +++ b/modules/nickserv/ns_register.cpp @@ -35,7 +35,7 @@ public: NickAlias *na = NickAlias::Find(nick); if (na == NULL) source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); - else if (na->nc->HasExt("UNCONFIRMED") == false) + else if (!na->nc->HasExt("UNCONFIRMED")) source.Reply(_("Nick \002%s\002 is already confirmed."), na->nick.c_str()); else { -- cgit