*/
-/* $ModDesc: Provides the /CHECK command to retrieve information on a user, channel, hostname or IP address */
-
#include "inspircd.h"
#include "listmode.h"
*/
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 = "<nickname>|<ip>|<hostmask>|<channel> <server>";
}
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));
/* 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