diff options
-rw-r--r-- | include/u_listmode.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/u_listmode.h b/include/u_listmode.h index 15c139f6b..b81cfbb84 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -55,7 +55,7 @@ class ListModeRequest : public Request { public: User* user; - const std::string literal; + std::string literal; const char extban; Channel* chan; @@ -83,6 +83,18 @@ class ListModeRequest : public Request { } + /** Check if a literal string is on a channel's list, optionally using an extban char. + * The Event::Send() event returns the ban string if the user is on the channel's list, + * or NULL if the user is not on the list. + * @param sender Sending module + * @param target Target module + * @param User to check against, e.g. "Bob!Bobbertson@weeblshouse" + * @param extbanchar Extended ban character to use for the match, or a null char if not using extban + */ + ListModeRequest(Module* sender, Module* target, User* u, char extbanchar, Channel* channel) : Request(sender, target, "LM_CHECKLIST_EX"), user(u), literal(""), extban(extbanchar), chan(channel) + { + } + /** Destructor */ ~ListModeRequest() @@ -487,7 +499,7 @@ class ListModeBase : public ModeHandler LM->chan->GetExt(GetInfoKey(), mlist); if (mlist) { - std::string mask = std::string(LM->user->nick) + "!" + LM->user->ident + "@" + LM->user->GetIPString(); + std::string mask = LM->user->nick + "!" + LM->user->ident + "@" + LM->user->GetIPString(); for (modelist::iterator it = mlist->begin(); it != mlist->end(); ++it) { if (InspIRCd::Match(LM->user->GetFullRealHost(), it->mask) || InspIRCd::Match(LM->user->GetFullHost(), it->mask) || (InspIRCd::MatchCIDR(mask, it->mask))) @@ -502,6 +514,9 @@ class ListModeBase : public ModeHandler LM->chan->GetExt(GetInfoKey(), mlist); if (mlist) { + if (LM->user) + LM->literal = LM->user->nick + "!" + LM->user->ident + "@" + LM->user->GetIPString(); + for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++) { if (LM->extban && it->mask.length() > 1 && it->mask[0] == LM->extban && it->mask[1] == ':') |