git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5754
e03df62e-2008-0410-955e-
edbf42e46eb7
-bool whomatch(userrec* user, const char* matchtext, bool opt_realname, bool opt_showrealhost)
+bool whomatch(userrec* user, const char* matchtext, bool opt_realname, bool opt_showrealhost, bool opt_mode)
{
bool realhost = false;
bool realname = false;
{
bool realhost = false;
bool realname = false;
if (user->registered != REG_ALL)
return false;
if (user->registered != REG_ALL)
return false;
+ if (opt_mode)
+ {
+ for (const char* n = matchtext; *n; n++)
+ {
+ if (*n == '+')
+ {
+ positive = true;
+ continue;
+ }
+ else if (*n == '-')
+ {
+ positive = false;
+ continue;
+ }
+ if (user->IsModeSet(*n) != positive)
+ return false;
+ }
+ return true;
+ }
+
if (opt_realname)
realname = match(user->fullname, matchtext);
if (opt_realname)
realname = match(user->fullname, matchtext);
bool opt_showrealhost = false;
bool opt_unlimit = false;
bool opt_realname = false;
bool opt_showrealhost = false;
bool opt_unlimit = false;
bool opt_realname = false;
chanrec *ch = NULL;
std::vector<std::string> whoresults;
chanrec *ch = NULL;
std::vector<std::string> whoresults;
case 'r':
opt_realname = true;
break;
case 'r':
opt_realname = true;
break;
+ case 'm':
+ opt_mode = true;
+ break;
- if (whomatch(oper, matchtext, opt_realname, opt_showrealhost))
+ if (whomatch(oper, matchtext, opt_realname, opt_showrealhost, opt_mode))
{
std::string wholine = initial;
{
std::string wholine = initial;
{
for (user_hash::iterator i = ServerInstance->clientlist.begin(); i != ServerInstance->clientlist.end(); i++)
{
{
for (user_hash::iterator i = ServerInstance->clientlist.begin(); i != ServerInstance->clientlist.end(); i++)
{
- if (whomatch(i->second, matchtext, opt_realname, opt_showrealhost))
+ if (whomatch(i->second, matchtext, opt_realname, opt_showrealhost, opt_mode))
{
std::string wholine = initial;
{
std::string wholine = initial;