]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
Delete modewatchers when unloading modules that use them to keep the server from...
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index 5987b70c9d02cdbe1e39b4a2177378d0d363f240..77a7377c6527e7f8a67f8636e1b4d72aa988926e 100644 (file)
@@ -27,7 +27,7 @@ class Channel_r : public ModeHandler
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
                // only a u-lined server may add or remove the +r mode.
-               if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
+               if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
                {
                        // Only change the mode if it's not redundant
                        if ((adding && !channel->IsModeSet('r')) || (!adding && channel->IsModeSet('r')))
@@ -56,7 +56,7 @@ class User_r : public ModeHandler
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
-               if (IS_REMOTE(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
+               if (!IS_LOCAL(source) || ServerInstance->ULine(source->nick.c_str()) || ServerInstance->ULine(source->server))
                {
                        if ((adding && !dest->IsModeSet('r')) || (!adding && dest->IsModeSet('r')))
                        {
@@ -104,7 +104,7 @@ class ModuleServicesAccount : public Module
        AUser_R m3;
        Channel_r m4;
        User_r m5;
-       StringExtItem accountname;
+       AccountExtItem accountname;
  public:
        ModuleServicesAccount() : m1(this), m2(this), m3(this), m4(this), m5(this),
                accountname("accountname", this)
@@ -115,11 +115,11 @@ class ModuleServicesAccount : public Module
                        !ServerInstance->Modes->AddMode(&m5))
                        throw ModuleException("Some other module has claimed our modes!");
 
-               Extensible::Register(&accountname);
+               ServerInstance->Extensions.Register(&accountname);
                Implementation eventlist[] = { I_OnWhois, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin, I_OnCheckBan,
-                       I_OnSyncUser, I_OnUserQuit, I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick };
+                       I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick };
 
-               ServerInstance->Modules->Attach(eventlist, this, 10);
+               ServerInstance->Modules->Attach(eventlist, this, 8);
        }
 
        void On005Numeric(std::string &t)
@@ -275,7 +275,7 @@ class ModuleServicesAccount : public Module
 
        Version GetVersion()
        {
-               return Version("Povides support for ircu-style services accounts, including chmode +R, etc.",VF_COMMON|VF_VENDOR,API_VERSION);
+               return Version("Povides support for ircu-style services accounts, including chmode +R, etc.",VF_COMMON|VF_VENDOR);
        }
 };