]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Save 4 bytes (assuming sizeof(ptr) == 2) per user record, storing unneeded pointers...
[user/henk/code/inspircd.git] / src / users.cpp
index c6a607a9f7ecd7ee944de2496476b7e40306376b..b749b4788f9aab419b2ee497895fcfaeaa293610 100644 (file)
@@ -99,6 +99,7 @@ void User::StartDNSLookup()
        {
                bool cached = false;
                const char* sip = this->GetIPString(false);
+               UserResolver *res_reverse;
 
                /* Special case for 4in6 (Have i mentioned i HATE 4in6?) */
                if (!strncmp(sip, "0::ffff:", 8))
@@ -200,7 +201,6 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance
        fd = -1;
        recvq.clear();
        sendq.clear();
-       res_forward = res_reverse = NULL;
        Visibility = NULL;
        ip = NULL;
        MyClass = NULL;
@@ -702,7 +702,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
        char* savept2;
 
        if (this->IsModeSet('o'))
-               this->Deoper();
+               this->UnOper();
 
        this->modes[UM_OPERATOR] = 1;
        this->WriteServ("MODE %s :+o", this->nick.c_str());
@@ -784,6 +784,13 @@ void User::UnOper()
 {
        if (IS_OPER(this))
        {
+               /*
+                * unset their oper type (what IS_OPER checks).
+                * note, order is important - this must come before modes as -o attempts
+                * to call UnOper. -- w00t
+                */
+               this->oper.clear();
+
                /* Remove all oper only modes from the user when the deoper - Bug #466*/
                std::string moderemove("-");
 
@@ -799,9 +806,6 @@ void User::UnOper()
                parameters.push_back(moderemove);
 
                ServerInstance->Parser->CallHandler("MODE", parameters, this);
-
-               /* unset their oper type (what IS_OPER checks), and remove +o */
-               this->oper.clear();
                        
                /* remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404 */
                ServerInstance->Users->all_opers.remove(this);