X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=0ad99fb94d3946778a487fdf0439551c4e86a243;hb=19963bd452eac3c9fc52b3ee60fbf1a81efed7d3;hp=d0533aee68d20848223a0b6695b88353828eb3fb;hpb=c2ec183ffe0fd0db4fe3c06874a888f84738f49c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index d0533aee6..0ad99fb94 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -92,14 +92,14 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset) return CMD_FAILURE; if (res != MOD_RES_ALLOW) { - FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (u,this,"topiclock")); - bool defok = IsModeSet('t') ? GetPrefixValue(u) >= HALFOP_VALUE : HasUser(u); - if (!res.check(defok)) + if (!this->HasUser(u)) { - if (!this->HasUser(u)) - u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str()); - else - u->WriteNumeric(482, "%s %s :You do not have access to change the topic on this channel", u->nick.c_str(), this->name.c_str()); + u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str()); + return CMD_FAILURE; + } + if (IsModeSet('t') && !ServerInstance->OnCheckExemption(u,this,"topiclock").check(GetPrefixValue(u) >= HALFOP_VALUE)) + { + u->WriteNumeric(482, "%s %s :You do not have access to change the topic on this channel", u->nick.c_str(), this->name.c_str()); return CMD_FAILURE; } } @@ -392,9 +392,8 @@ Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs, for(unsigned int i=0; i < memb->modes.length(); i++) ms.append(" ").append(user->nick); if ((Ptr->GetUserCounter() > 1) && (ms.length())) - Ptr->WriteAllExceptSender(user, true, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str()); + Ptr->WriteAllExceptSender(user, ServerInstance->Config->CycleHostsFromUser, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str()); - /* Major improvement by Brain - we dont need to be calculating all this pointlessly for remote users */ if (IS_LOCAL(user)) { if (Ptr->topicset)