diff options
| author | 2022-10-13 08:17:33 +0100 | |
|---|---|---|
| committer | 2022-10-13 08:17:33 +0100 | |
| commit | d97a8f15de81cca6cfd577f1a87eccfe8b65f104 (patch) | |
| tree | 681d76e9fd326fec3f71dd88290ae58e1039eae1 /src/coremods | |
| parent | Add the inspircd.org/echo tag to echo message responses. (diff) | |
Fix the default case in GetFirstVisibleChannel and document it.
Diffstat (limited to 'src/coremods')
| -rw-r--r-- | src/coremods/core_who.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index 160590814..5b07d76af 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -180,8 +180,11 @@ class CommandWho : public SplitCommand if (res == MOD_RES_DENY) continue; // Module explicitly rejected this chan. - // A module didn't specify either way so use the default behaviour. - if (source == user || !memb->chan->IsModeSet(secretmode) || !memb->chan->IsModeSet(privatemode) || memb->chan->HasUser(source)) + // A module didn't specify either way so use the default behaviour: + // 1. The requesting user is getting a WHO response for themself. + // 2. The +s (secret) and +p (private) channel modes are not set. + // 3. The requesting user is a member of the channel. + if (source == user || (!memb->chan->IsModeSet(secretmode) && !memb->chan->IsModeSet(privatemode)) || memb->chan->HasUser(source)) return memb; } return NULL; |
