X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cap.cpp;h=6e3033bf27edd28e9cd164ef7040697519e5deaa;hb=9cf381330eab69d7e5bf26684d1ec8075aee60a2;hp=922061757306b878c418dc3c23a322fd48c5c9be;hpb=77730fd5f09f8fc193205654c8bba84d34365670;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 922061757..6e3033bf2 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -407,13 +407,21 @@ class CommandCap : public SplitCommand } else if ((subcommand == "LS") || (subcommand == "LIST")) { + Cap::Protocol capversion = Cap::CAP_LEGACY; const bool is_ls = (subcommand.length() == 2); - if ((is_ls) && (parameters.size() > 1) && (parameters[1] == "302")) - manager.Set302Protocol(user); + if ((is_ls) && (parameters.size() > 1)) + { + unsigned int version = ConvToNum(parameters[1]); + if (version >= 302) + { + capversion = Cap::CAP_302; + manager.Set302Protocol(user); + } + } std::string result; // Show values only if supports v3.2 and doing LS - manager.HandleList(result, user, is_ls, ((is_ls) && (manager.GetProtocol(user) != Cap::CAP_LEGACY))); + manager.HandleList(result, user, is_ls, ((is_ls) && (capversion != Cap::CAP_LEGACY))); DisplayResult(user, subcommand, result); } else if ((subcommand == "CLEAR") && (manager.GetProtocol(user) == Cap::CAP_LEGACY))