* similar purposes.
* @param user The username to look up
* @param channel The channel name to look up the privilages of the user for
+ * @param nick_suffix true (the default) if you want nicknames in the mode string, for easy
+ * use with the mode stacker, false if you just want the "avh" part of "avh nick nick nick".
* @return The mode string.
*/
- std::string ModeString(User* user, Channel* channel);
+ std::string ModeString(User* user, Channel* channel, bool nick_suffix = true);
};
#endif
return NULL;
}
-std::string ModeParser::ModeString(User* user, Channel* channel)
+std::string ModeParser::ModeString(User* user, Channel* channel, bool nick_suffix)
{
std::string types;
std::string pars;
ret = mh->ModeSet(NULL, user, channel, user->nick);
if ((ret.first) && (ret.second == user->nick))
{
- pars.append(" ");
- pars.append(user->nick);
+ if (nick_suffix)
+ {
+ pars.append(" ");
+ pars.append(user->nick);
+ }
types.push_back(mh->GetModeChar());
}
}
}
- return types+pars;
+ if (nick_suffix)
+ return types+pars;
+ else
+ return types;
}
std::string ModeParser::ChanModes()