]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_channel/cmd_kick.cpp
core_list Check whether the chan name/topic has to be Match()ed once, not once per...
[user/henk/code/inspircd.git] / src / coremods / core_channel / cmd_kick.cpp
index dfa9bf21740042d172a4ff31afe8bd58ed45d646..051cc2678986032e8e063b37d1b0a3cf992a7799 100644 (file)
@@ -73,6 +73,17 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
        }
        Membership* const memb = victimiter->second;
 
+       // KICKs coming from servers can carry a membership id
+       if ((!IS_LOCAL(user)) && (parameters.size() > 3))
+       {
+               // If the current membership id is not equal to the one in the message then the user rejoined
+               if (memb->id != Membership::IdFromString(parameters[2]))
+               {
+                       ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Dropped KICK due to membership id mismatch: " + ConvToStr(memb->id) + " != " + parameters[2]);
+                       return CMD_FAILURE;
+               }
+       }
+
        const bool has_reason = (parameters.size() > 2);
        const std::string reason((has_reason ? parameters.back() : user->nick), 0, ServerInstance->Config->Limits.MaxKick);