]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_hideoper Fix wrong /WHO output for hidden opers if the channel name contains '*'
authorAttila Molnar <attilamolnar@hush.com>
Sat, 17 Jan 2015 14:27:09 +0000 (15:27 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 17 Jan 2015 14:27:09 +0000 (15:27 +0100)
src/modules/m_hideoper.cpp

index b83c7de1afc511f4eef737f527946938e3e8a89e..88b0c4cdffbf544f5ed12a1a5746162cdf152a6d 100644 (file)
@@ -82,7 +82,11 @@ class ModuleHideOper : public Module
                if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex"))
                {
                        // hide the "*" that marks the user as an oper from the /WHO line
-                       std::string::size_type pos = line.find("*");
+                       std::string::size_type spcolon = line.find(" :");
+                       if (spcolon == std::string::npos)
+                               return; // Another module hid the user completely
+                       std::string::size_type sp = line.rfind(' ', spcolon-1);
+                       std::string::size_type pos = line.find('*', sp);
                        if (pos != std::string::npos)
                                line.erase(pos, 1);
                        // hide the line completely if doing a "/who * o" query