]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Increase the size of the matrix for map drawing to 250x250
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index 357db554f6a9d181fb73c22c928525ffd0754ec0..86e810bc29d3b149da175777e4a8b5df2e61d0d3 100644 (file)
@@ -23,7 +23,7 @@ class PermChannel : public ModeHandler
  public:
        PermChannel(InspIRCd* Instance) : ModeHandler(Instance, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                if (adding)
                {
@@ -38,6 +38,9 @@ class PermChannel : public ModeHandler
                        if (channel->IsModeSet('P'))
                        {
                                channel->SetMode('P',false);
+
+                               if (channel->GetUserCounter() == 0)
+                                       delete channel;
                                return MODEACTION_ALLOW;
                        }
                }
@@ -50,7 +53,7 @@ class ModulePermanentChannels : public Module
 {
        PermChannel *p;
 public:
-       
+
        ModulePermanentChannels(InspIRCd* Me) : Module(Me)
        {
                p = new PermChannel(ServerInstance);
@@ -71,7 +74,7 @@ public:
 
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+               return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 
        virtual int OnChannelPreDelete(Channel *c)