]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Add UserManager::NextAlreadySentId() and convert all code to use it
[user/henk/code/inspircd.git] / src / users.cpp
index 4dffe6056a8a3b25131aacbcd59df342b89f1a60..2585443126c8f85a40cc5617d23679e2a3c72eb9 100644 (file)
@@ -139,28 +139,6 @@ const std::string& User::GetFullRealHost()
        return this->cached_fullrealhost;
 }
 
-InviteList& LocalUser::GetInviteList()
-{
-       RemoveExpiredInvites();
-       return invites;
-}
-
-bool LocalUser::RemoveInvite(Channel* chan)
-{
-       Invitation* inv = Invitation::Find(chan, this);
-       if (inv)
-       {
-               delete inv;
-               return true;
-       }
-       return false;
-}
-
-void LocalUser::RemoveExpiredInvites()
-{
-       Invitation::Find(NULL, this);
-}
-
 bool User::HasModePermission(unsigned char, ModeType)
 {
        return true;
@@ -328,7 +306,6 @@ CullResult User::cull()
 
 CullResult LocalUser::cull()
 {
-       ClearInvites();
        eh.cull();
        return User::cull();
 }
@@ -764,7 +741,7 @@ void LocalUser::Write(const std::string& text)
        if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
        {
                // this should happen rarely or never. Crop the string at 512 and try again.
-               std::string try_again(0, ServerInstance->Config->Limits.MaxLine - 2);
+               std::string try_again(text, 0, ServerInstance->Config->Limits.MaxLine - 2);
                Write(try_again);
                return;
        }
@@ -866,9 +843,6 @@ namespace
 
 void User::WriteCommon(const char* text, ...)
 {
-       if (this->registered != REG_ALL || quitting)
-               return;
-
        std::string textbuffer;
        VAFORMAT(textbuffer, text, text);
        textbuffer = ":" + this->GetFullHost() + " " + textbuffer;
@@ -877,9 +851,6 @@ void User::WriteCommon(const char* text, ...)
 
 void User::WriteCommonRaw(const std::string &line, bool include_self)
 {
-       if (this->registered != REG_ALL || quitting)
-               return;
-
        WriteCommonRawHandler handler(line);
        ForEachNeighbor(handler, include_self);
 }
@@ -902,7 +873,7 @@ void User::ForEachNeighbor(ForEachNeighborHandler& handler, bool include_self)
        FOREACH_MOD(OnBuildNeighborList, (this, include_chans, exceptions));
 
        // Get next id, guaranteed to differ from the already_sent field of all users
-       const already_sent_t newid = ++LocalUser::already_sent_id;
+       const already_sent_t newid = ServerInstance->Users.NextAlreadySentId();
 
        // Handle exceptions first
        for (std::map<User*, bool>::const_iterator i = exceptions.begin(); i != exceptions.end(); ++i)