]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_notice.cpp
Add REG_ALL checks to treat unregistered users as nonexistent in more cases
[user/henk/code/inspircd.git] / src / commands / cmd_notice.cpp
index e10d6286d0ec2aae568aa631501666e0536d832a..d5ef7ba1d0f2cf36f97f45c3ff01605dc1e314f8 100644 (file)
@@ -110,6 +110,15 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
                                        user->WriteNumeric(404, "%s %s :Cannot send to channel (+m)", user->nick.c_str(), chan->name.c_str());
                                        return CMD_FAILURE;
                                }
+
+                               if (ServerInstance->Config->RestrictBannedUsers)
+                               {
+                                       if (chan->IsBanned(user))
+                                       {
+                                               user->WriteNumeric(404, "%s %s :Cannot send to channel (you're banned)", user->nick.c_str(), chan->name.c_str());
+                                               return CMD_FAILURE;
+                                       }
+                               }
                        }
                        ModResult MOD_RESULT;
 
@@ -180,7 +189,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
        else
                dest = ServerInstance->FindNick(destnick);
 
-       if (dest)
+       if ((dest) && (dest->registered == REG_ALL))
        {
                if (parameters[1].empty())
                {