X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_check.cpp;h=25835297904c74973e60c59a3aca71387e2f2cdc;hb=b14ebbccf08ec34a73e1ba271e67da80d9fe805c;hp=e8f077a7ba8c67fce997b933bc7db545fa064c3f;hpb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index e8f077a7b..258352979 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -20,8 +20,6 @@ */ -/* $ModDesc: Provides the /CHECK command to retrieve information on a user, channel, hostname or IP address */ - #include "inspircd.h" #include "listmode.h" @@ -29,11 +27,25 @@ */ class CommandCheck : public Command { - ModeReference ban; + ChanModeReference ban; + UserModeReference snomaskmode; + + std::string GetSnomasks(User* user) + { + std::string ret; + if (snomaskmode) + ret = snomaskmode->GetUserParameter(user); + + if (ret.empty()) + ret = "+"; + return ret; + } + public: CommandCheck(Module* parent) : Command(parent,"CHECK", 1) , ban(parent, "ban") + , snomaskmode(parent, "snomask") { flags_needed = 'o'; syntax = "||| "; } @@ -94,7 +106,7 @@ class CommandCheck : public Command user->SendText(checkstr + " realnuh " + targuser->GetFullRealHost()); user->SendText(checkstr + " realname " + targuser->fullname); user->SendText(checkstr + " modes +" + targuser->FormatModes()); - user->SendText(checkstr + " snomasks +" + targuser->FormatNoticeMasks()); + user->SendText(checkstr + " snomasks " + GetSnomasks(targuser)); user->SendText(checkstr + " server " + targuser->server); user->SendText(checkstr + " uid " + targuser->uuid); user->SendText(checkstr + " signon " + timestring(targuser->signon)); @@ -113,7 +125,7 @@ class CommandCheck : public Command { OperInfo* oper = targuser->oper; /* user is an oper of type ____ */ - user->SendText(checkstr + " opertype " + oper->NameStr()); + user->SendText(checkstr + " opertype " + oper->name); if (loctarg) { std::string umodes; @@ -194,12 +206,13 @@ class CommandCheck : public Command /* note that unlike /names, we do NOT check +i vs in the channel */ for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++) { - char tmpbuf[MAXBUF]; /* - * Unlike Asuka, I define a clone as coming from the same host. --w00t - */ - snprintf(tmpbuf, MAXBUF, "%-3lu %s%s (%s@%s) %s ", ServerInstance->Users->GlobalCloneCount(i->first), targchan->GetAllPrefixChars(i->first), i->first->nick.c_str(), i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str()); - user->SendText(checkstr + " member " + tmpbuf); + * Unlike Asuka, I define a clone as coming from the same host. --w00t + */ + user->SendText("%s member %-3lu %s%s (%s@%s) %s ", + checkstr.c_str(), ServerInstance->Users->GlobalCloneCount(i->first), + targchan->GetAllPrefixChars(i->first), i->first->nick.c_str(), + i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str()); } // We know that the mode handler for bans is in the core and is derived from ListModeBase @@ -207,7 +220,7 @@ class CommandCheck : public Command banlm->DoSyncChannel(targchan, creator, user); // Show other listmodes as well - FOREACH_MOD(I_OnSyncChannel,OnSyncChannel(targchan,creator,user)); + FOREACH_MOD(OnSyncChannel, (targchan,creator,user)); dumpExt(user, checkstr, targchan); } else