]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_stripcolor.cpp
Fix some indenting.
[user/henk/code/inspircd.git] / src / modules / m_stripcolor.cpp
index 97df7f193c1682be65b2534ca9f2a4a87ec994d2..420e2e6e293c1ad0413b86142b6dd2c7f1f82425 100644 (file)
 
 /** Handles channel mode +S
  */
-class ChannelStripColor : public ModeHandler
+class ChannelStripColor : public SimpleChannelModeHandler
 {
  public:
-       ChannelStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_CHANNEL, false) { }
-
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
-       {
-               if (adding)
-               {
-                       if (!channel->IsModeSet('S'))
-                       {
-                               channel->SetMode('S',true);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-               else
-               {
-                       if (channel->IsModeSet('S'))
-                       {
-                               channel->SetMode('S',false);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-
-               return MODEACTION_DENY;
-       }
+       ChannelStripColor(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'S') { }
 };
 
 /** Handles user mode +S
  */
-class UserStripColor : public ModeHandler
+class UserStripColor : public SimpleUserModeHandler
 {
  public:
-       UserStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_USER, false) { }
-
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
-       {
-               /* Only opers can change other users modes */
-               if (source != dest)
-                       return MODEACTION_DENY;
-
-               if (adding)
-               {
-                       if (!dest->IsModeSet('S'))
-                       {
-                               dest->SetMode('S',true);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-               else
-               {
-                       if (dest->IsModeSet('S'))
-                       {
-                               dest->SetMode('S',false);
-                               return MODEACTION_ALLOW;
-                       }
-               }
-
-               return MODEACTION_DENY;
-       }
+       UserStripColor(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'S') { }
 };
 
 
@@ -135,13 +87,11 @@ class ModuleStripColor : public Module
                                        --i;
                                        sentence.erase(safei);
                                        ++i;
-                                       ServerInstance->Logs->Log("m_stripcolor", DEBUG, "Sentence: %s iter pos %c", sentence.c_str(), *i);
                                }
                                else
                                {
                                        sentence.erase(i);
                                        i = sentence.begin();
-                                       ServerInstance->Logs->Log("m_stripcolor", DEBUG, "Sentence begin(): %s iter pos %c", sentence.c_str(), *i);
                                }
                        }
                        else