]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Check maximum length of ban list for local users, not remote
[user/henk/code/inspircd.git] / src / channels.cpp
index 0b9eb1cc478d1681ecfcb1a8fd59b6915f046844..0ad99fb94d3946778a487fdf0439551c4e86a243 100644 (file)
@@ -97,7 +97,7 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset)
                                u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str());
                                return CMD_FAILURE;
                        }
-                       if ((this->IsModeSet('t')) && (this->GetPrefixValue(u) < HALFOP_VALUE))
+                       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)
@@ -746,20 +745,14 @@ void Channel::UserList(User *user)
 {
        char list[MAXBUF];
        size_t dlen, curlen;
-       ModResult call_modules;
 
        if (!IS_LOCAL(user))
                return;
 
-       FIRST_MOD_RESULT(OnUserList, call_modules, (user, this));
-
-       if (call_modules != MOD_RES_ALLOW)
+       if (this->IsModeSet('s') && !this->HasUser(user) && !user->HasPrivPermission("channels/auspex"))
        {
-               if ((this->IsModeSet('s')) && (!this->HasUser(user)))
-               {
-                       user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
-                       return;
-               }
+               user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
+               return;
        }
 
        dlen = curlen = snprintf(list,MAXBUF,"%s %c %s :", user->nick.c_str(), this->IsModeSet('s') ? '@' : this->IsModeSet('p') ? '*' : '=',  this->name.c_str());
@@ -786,14 +779,11 @@ void Channel::UserList(User *user)
                std::string prefixlist = this->GetPrefixChar(i->first);
                std::string nick = i->first->nick;
 
-               if (call_modules != MOD_RES_DENY)
-               {
-                       FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->second, prefixlist, nick));
+               FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->second, prefixlist, nick));
 
-                       /* Nick was nuked, a module wants us to skip it */
-                       if (nick.empty())
-                               continue;
-               }
+               /* Nick was nuked, a module wants us to skip it */
+               if (nick.empty())
+                       continue;
 
                size_t ptrlen = 0;