]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Allow static build of inspircd without module support
[user/henk/code/inspircd.git] / src / channels.cpp
index fd9861279e15258972b5086b10cdce92c3c1c0ed..3f0fc4a36271077bc78b15f056b86a109210c6c7 100644 (file)
@@ -377,7 +377,9 @@ Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs,
        Ptr->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", Ptr->name.c_str());
 
        /* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
-       std::string ms = ServerInstance->Modes->ModeString(user, Ptr);
+       std::string ms = memb->modes;
+       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());
 
@@ -644,19 +646,19 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList
 
 void Channel::RawWriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const std::string &out)
 {
-       char statmode = 0;
+       unsigned int minrank = 0;
        if (status)
        {
                ModeHandler* mh = ServerInstance->Modes->FindPrefix(status);
                if (mh)
-                       statmode = mh->GetModeChar();
+                       minrank = mh->GetPrefixRank();
        }
        for (UserMembIter i = userlist.begin(); i != userlist.end(); i++)
        {
-               if ((IS_LOCAL(i->first)) && (except_list.find(i->first) == except_list.end()))
+               if (IS_LOCAL(i->first) && (except_list.find(i->first) == except_list.end()))
                {
-                       /* User doesnt have the status we're after */
-                       if (statmode && !i->second->hasMode(statmode))
+                       /* User doesn't have the status we're after */
+                       if (minrank && i->second->getRank() < minrank)
                                continue;
 
                        i->first->Write(out);