X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_check.cpp;h=58e71aadcc3e4004c6eb4fe3708a63f19a771769;hb=d4a1ea70451abb333e71f9cff09b624db59531a0;hp=ecfe4dcb4ab7942f2abadf39e5acdf8ddcecf698;hpb=f434c03f518d8aa9e7ee088e28125a947e6c95a5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index ecfe4dcb4..58e71aadc 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -67,16 +67,21 @@ class CheckContext User* GetUser() const { return user; } - void DumpListMode(const ListModeBase::ModeList* list) + void DumpListMode(ListModeBase* mode, Channel* chan) { + const ListModeBase::ModeList* list = mode->GetList(chan); if (!list) return; - CheckContext::List modelist(*this, "modelist"); for (ListModeBase::ModeList::const_iterator i = list->begin(); i != list->end(); ++i) - modelist.Add(i->mask); - - modelist.Flush(); + { + CheckContext::List listmode(*this, "listmode"); + listmode.Add(ConvToStr(mode->GetModeChar())); + listmode.Add(i->mask); + listmode.Add(i->setter); + listmode.Add(FormatTime(i->time)); + listmode.Flush(); + } } void DumpExt(Extensible* ext) @@ -196,16 +201,10 @@ class CommandCheck : public Command context.Write("opertype", oper->name); if (loctarg) { - std::string umodes = GetAllowedOperOnlyModes(loctarg, MODETYPE_USER); - std::string cmodes = GetAllowedOperOnlyModes(loctarg, MODETYPE_CHANNEL); - context.Write("modeperms", "user=" + umodes + " channel=" + cmodes); - - CheckContext::List opcmdlist(context, "commandperms"); - opcmdlist.Add(oper->AllowedOperCommands.ToString()); - opcmdlist.Flush(); - CheckContext::List privlist(context, "permissions"); - privlist.Add(oper->AllowedPrivs.ToString()); - privlist.Flush(); + context.Write("chanmodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_CHANNEL)); + context.Write("usermodeperms", GetAllowedOperOnlyModes(loctarg, MODETYPE_USER)); + context.Write("commandperms", oper->AllowedOperCommands.ToString()); + context.Write("permissions", oper->AllowedPrivs.ToString()); } } @@ -241,7 +240,7 @@ class CommandCheck : public Command else if (targchan) { /* /check on a channel */ - context.Write("timestamp", targchan->age); + context.Write("createdat", targchan->age); if (!targchan->topic.empty()) { @@ -265,14 +264,14 @@ class CommandCheck : public Command * Unlike Asuka, I define a clone as coming from the same host. --w00t */ const UserManager::CloneCounts& clonecount = ServerInstance->Users->GetCloneCounts(i->first); - context.Write("member", InspIRCd::Format("%-3u %s%s (%s@%s) %s ", clonecount.global, - i->second->GetAllPrefixChars().c_str(), i->first->nick.c_str(), - i->first->ident.c_str(), i->first->GetDisplayedHost().c_str(), i->first->GetRealName().c_str())); + context.Write("member", InspIRCd::Format("%u %s%s (%s)", clonecount.global, + i->second->GetAllPrefixChars().c_str(), i->first->GetFullHost().c_str(), + i->first->GetRealName().c_str())); } const ModeParser::ListModeList& listmodes = ServerInstance->Modes->GetListModes(); for (ModeParser::ListModeList::const_iterator i = listmodes.begin(); i != listmodes.end(); ++i) - context.DumpListMode((*i)->GetList(targchan)); + context.DumpListMode(*i, targchan); context.DumpExt(targchan); }