]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Remove needless chdir() from inspircd executable
[user/henk/code/inspircd.git] / src / users.cpp
index ba3b9bec8c1a168b7e44b411fe3ae7ff66c0eca4..7952c98ac7eb7dc8f3b0b2b006b0012f3d4ec907 100644 (file)
@@ -1200,7 +1200,7 @@ void User::WriteCommon(const char* text, ...)
        char textbuffer[MAXBUF];
        va_list argsPtr;
 
-       if (this->registered != REG_ALL || !IS_LOCAL(this) || quitting)
+       if (this->registered != REG_ALL || quitting)
                return;
 
        int len = snprintf(textbuffer,MAXBUF,":%s ",this->GetFullHost().c_str());
@@ -1217,7 +1217,7 @@ void User::WriteCommonExcept(const char* text, ...)
        char textbuffer[MAXBUF];
        va_list argsPtr;
 
-       if (this->registered != REG_ALL || !IS_LOCAL(this) || quitting)
+       if (this->registered != REG_ALL || quitting)
                return;
 
        int len = snprintf(textbuffer,MAXBUF,":%s ",this->GetFullHost().c_str());
@@ -1231,7 +1231,7 @@ void User::WriteCommonExcept(const char* text, ...)
 
 void User::WriteCommonRaw(const std::string &line, bool include_self)
 {
-       if (this->registered != REG_ALL || !IS_LOCAL(this) || quitting)
+       if (this->registered != REG_ALL || quitting)
                return;
 
        if (!already_sent)
@@ -1401,7 +1401,8 @@ void User::DoHostCycle(const std::string &quitline)
        if (!ServerInstance->Config->CycleHosts)
                return;
 
-       uniq_id++;
+       unsigned int silent_id = ++uniq_id;
+       unsigned int seen_id = ++uniq_id;
 
        if (!already_sent)
                InitializeAlreadySent(ServerInstance->SE);
@@ -1416,9 +1417,15 @@ void User::DoHostCycle(const std::string &quitline)
                User* u = i->first;
                if (IS_LOCAL(u) && !u->quitting)
                {
-                       already_sent[u->fd] = uniq_id;
                        if (i->second)
+                       {
+                               already_sent[u->fd] = seen_id;
                                u->Write(quitline);
+                       }
+                       else
+                       {
+                               already_sent[u->fd] = silent_id;
+                       }
                }
        }
        for (UCListIter v = include_c.begin(); v != include_c.end(); ++v)
@@ -1439,11 +1446,13 @@ void User::DoHostCycle(const std::string &quitline)
                        User* u = i->first;
                        if (u == this || !IS_LOCAL(u))
                                continue;
+                       if (already_sent[u->fd] == silent_id)
+                               continue;
 
-                       if (already_sent[i->first->fd] != uniq_id)
+                       if (already_sent[u->fd] != seen_id)
                        {
                                u->Write(quitline);
-                               already_sent[i->first->fd] = uniq_id;
+                               already_sent[i->first->fd] = seen_id;
                        }
                        u->Write(joinline);
                        if (modeline.length() > 0)