diff options
-rw-r--r-- | src/stats.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stats.cpp b/src/stats.cpp index 9d1970b3b..ef708251f 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -268,6 +268,30 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) } } break; + case 'O': + { + for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++) + { + // just the types, not the actual oper blocks... + if (i->first[0] != ' ') + continue; + OperInfo* tag = i->second; + tag->init(); + std::string umodes; + std::string cmodes; + for(char c='A'; c < 'z'; c++) + { + ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER); + if (mh && mh->NeedsOper() && tag->AllowedUserModes[c]) + umodes.push_back(c); + mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL); + if (mh && mh->NeedsOper() && tag->AllowedChanModes[c]) + cmodes.push_back(c); + } + results.push_back(sn+" 243 "+user->nick+" O"+tag->name + " " + umodes + " " + cmodes); + } + } + break; /* stats l (show user I/O stats) */ case 'l': |