]> 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 adf32b752771cad620ce71cb1450edd79b6885d9..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;
@@ -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);