]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_check.cpp
Add User::WriteRemoteNotice()
[user/henk/code/inspircd.git] / src / modules / m_check.cpp
index cbdb1d528e0f32b51cd62895a43b0cde084b6e4e..b6665f29b2982b4b38052acfd10789caf9fc935a 100644 (file)
@@ -73,8 +73,10 @@ class CommandCheck : public Command
        {
                char timebuf[60];
                struct tm *mytime = gmtime(&time);
-               strftime(timebuf, 59, "%Y-%m-%d %H:%M:%S UTC (%s)", mytime);
-               return std::string(timebuf);
+               strftime(timebuf, 59, "%Y-%m-%d %H:%M:%S UTC (", mytime);
+               std::string ret(timebuf);
+               ret.append(ConvToStr(time)).push_back(')');
+               return ret;
        }
 
        void dumpExt(User* user, const std::string& checkstr, Extensible* ext)
@@ -95,7 +97,7 @@ class CommandCheck : public Command
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName.c_str())
+               if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName)
                        return CMD_SUCCESS;
 
                User *targuser;
@@ -149,7 +151,7 @@ class CommandCheck : public Command
                                {
                                        std::string umodes;
                                        std::string cmodes;
-                                       for(char c='A'; c < 'z'; c++)
+                                       for(char c='A'; c <= 'z'; c++)
                                        {
                                                ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER);
                                                if (mh && mh->NeedsOper() && loctarg->HasModePermission(c, MODETYPE_USER))
@@ -160,7 +162,7 @@ class CommandCheck : public Command
                                        }
                                        user->SendText(checkstr + " modeperms user=" + umodes + " channel=" + cmodes);
                                        std::string opcmds;
-                                       for(std::set<std::string>::iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); i++)
+                                       for (OperInfo::PrivSet::const_iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); ++i)
                                        {
                                                opcmds.push_back(' ');
                                                opcmds.append(*i);
@@ -168,7 +170,7 @@ class CommandCheck : public Command
                                        std::stringstream opcmddump(opcmds);
                                        user->SendText(checkstr + " commandperms", opcmddump);
                                        std::string privs;
-                                       for(std::set<std::string>::iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); i++)
+                                       for (OperInfo::PrivSet::const_iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); ++i)
                                        {
                                                privs.push_back(' ');
                                                privs.append(*i);
@@ -211,7 +213,7 @@ class CommandCheck : public Command
                        /* /check on a channel */
                        user->SendText(checkstr + " timestamp " + timestring(targchan->age));
 
-                       if (targchan->topic[0] != 0)
+                       if (!targchan->topic.empty())
                        {
                                /* there is a topic, assume topic related information exists */
                                user->SendText(checkstr + " topic " + targchan->topic);