]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Fix multiple (useless) linefeeds on the end of ADDLINE in burst
[user/henk/code/inspircd.git] / src / users.cpp
index f1c3a3fef01577472921287d85dfb34cdf1b1e7c..aeb9852377fc865bee0042d86e7d05b9e69ac252 100644 (file)
@@ -73,6 +73,9 @@ std::string User::ProcessNoticeMasks(const char *sm)
                                                output += *c;
                                        }
                                }
+                               else
+                                       this->WriteServ("501 %s %c :is unknown snomask char to me", this->nick, *c);
+
                                oldadding = adding;
                        break;
                }
@@ -700,11 +703,27 @@ void User::UnOper()
 {
        if (IS_OPER(this))
        {
-               // unset their oper type (what IS_OPER checks), and remove +o
+               /* Remove all oper only modes from the user when the deoper - Bug #466*/
+               std::string moderemove("-");
+
+               for (unsigned char letter = 'A'; letter <= 'z'; letter++)
+               {
+                       if (letter != 'o')
+                       {
+                               ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_USER);
+                               if (mh && mh->NeedsOper())
+                                       moderemove += letter;
+                       }
+               }
+
+               const char* parameters[] = { this->nick, moderemove.c_str() };
+               ServerInstance->Parser->CallHandler("MODE", parameters, 2, this);
+
+               /* unset their oper type (what IS_OPER checks), and remove +o */
                *this->oper = 0;
                this->modes[UM_OPERATOR] = 0;
                        
-               // remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404
+               /* remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404 */
                ServerInstance->Users->all_opers.remove(this);
 
                if (AllowedOperCommands)