Add the matched channel to the WHO request data.

This commit is contained in:
Sadie Powell 2022-10-07 18:11:12 +01:00
parent d24b04308b
commit a54b78fb9d
2 changed files with 7 additions and 3 deletions

View File

@ -82,6 +82,9 @@ class Who::Request
/** The text to match against. */
std::string matchtext;
/** If the target was a channel then the matched channel */
Channel* matchchan;
/** The WHO/WHOX responses we will send to the source. */
std::vector<Numeric::Numeric> results;
@ -108,6 +111,7 @@ class Who::Request
protected:
Request()
: fuzzy_match(false)
, matchchan(NULL)
, whox(false)
{
}

View File

@ -608,9 +608,9 @@ CmdResult CommandWho::HandleLocal(LocalUser* user, const Params& parameters)
WhoData data(parameters);
// Is the source running a WHO on a channel?
Channel* chan = ServerInstance->FindChan(data.matchtext);
if (chan)
WhoChannel(user, parameters, chan, data);
data.matchchan = ServerInstance->FindChan(data.matchtext);
if (data.matchchan)
WhoChannel(user, parameters, data.matchchan, data);
// If we only want to match against opers we only have to iterate the oper list.
else if (data.flags['o'])