]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opermodes.cpp
Sync helpop chmodes s and p with docs
[user/henk/code/inspircd.git] / src / modules / m_opermodes.cpp
index 7ab54cedf15c014992be7b9c07ce05fbbc6a8e2f..2f93ec5f1731efd953a0522bd5d503ba8c8020da 100644 (file)
@@ -1,10 +1,14 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012, 2014 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
- *   Copyright (C) 2005-2007 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2005, 2010 Craig Edwards <brain@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -27,7 +31,7 @@ class ModuleModesOnOper : public Module
  public:
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Sets (and unsets) modes on opers when they oper up", VF_VENDOR);
+               return Version("Allows the server administrator to set user modes on server operators when they log into their server operator account.", VF_VENDOR);
        }
 
        void OnPostOper(User* user, const std::string &opertype, const std::string &opername) CXX11_OVERRIDE
@@ -52,15 +56,15 @@ class ModuleModesOnOper : public Module
                        smodes = "+" + smodes;
 
                std::string buf;
-               std::stringstream ss(smodes);
-               std::vector<std::string> modes;
+               irc::spacesepstream ss(smodes);
+               CommandBase::Params modes;
 
                modes.push_back(u->nick);
                // split into modes and mode params
-               while (ss >> buf)
+               while (ss.GetToken(buf))
                        modes.push_back(buf);
 
-               ServerInstance->Modes->Process(modes, u);
+               ServerInstance->Parser.CallHandler("MODE", modes, u);
        }
 };