]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_namedmodes Only show chan key to members and opers with channels/auspex
authorAttila Molnar <attilamolnar@hush.com>
Sat, 13 Feb 2016 18:35:17 +0000 (19:35 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 13 Feb 2016 18:35:17 +0000 (19:35 +0100)
src/modules/m_namedmodes.cpp

index cad18cff48b586456018efcf88664d6be04d524e..46710946b67a7adde9193e01aa4a14733a8d93d3 100644 (file)
@@ -33,7 +33,12 @@ static void DisplayList(User* user, Channel* channel)
                        continue;
                items << " +" << mh->name;
                if (mh->GetNumParams(true))
-                       items << " " << channel->GetModeParameter(letter);
+               {
+                       if ((letter == 'k') && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex")))
+                               items << " <key>";
+                       else
+                               items << " " << channel->GetModeParameter(letter);
+               }
        }
        char pfx[MAXBUF];
        snprintf(pfx, MAXBUF, ":%s 961 %s %s", ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), channel->name.c_str());