]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Merge tag 'v2.0.25' into master.
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index 22513abeafdb8c20fc27da671425e4925f43d1ca..0f2a2ef6f3506c069fa6d0175bd462474e2ed2c0 100644 (file)
@@ -207,16 +207,16 @@ public:
                                c = new Channel(channel, TS);
 
                                unsigned int topicset = tag->getInt("topicts");
-                               c->topic = tag->getString("topic");
+                               std::string topic = tag->getString("topic");
 
-                               if ((topicset != 0) || (!c->topic.empty()))
+                               if ((topicset != 0) || (!topic.empty()))
                                {
                                        if (topicset == 0)
                                                topicset = ServerInstance->Time();
-                                       c->topicset = topicset;
-                                       c->setby = tag->getString("topicsetby");
-                                       if (c->setby.empty())
-                                               c->setby = ServerInstance->Config->ServerName;
+                                       std::string topicsetby = tag->getString("topicsetby");
+                                       if (topicsetby.empty())
+                                               topicsetby = ServerInstance->Config->ServerName;
+                                       c->SetTopic(ServerInstance->FakeClient, topic, topicset, &topicsetby);
                                }
 
                                ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Added %s with topic %s", channel.c_str(), c->topic.c_str());
@@ -236,7 +236,7 @@ public:
                                        ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL);
                                        if (mode)
                                        {
-                                               if (mode->GetNumParams(true))
+                                               if (mode->NeedsParam(true))
                                                        list.GetToken(par);
                                                else
                                                        par.clear();
@@ -244,6 +244,10 @@ public:
                                                mode->OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, c, par, true);
                                        }
                                }
+
+                               // We always apply the permchannels mode to permanent channels.
+                               par.clear();
+                               p.OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, c, par, true);
                        }
                }
        }
@@ -269,7 +273,7 @@ public:
                dirty = false;
        }
 
-       void Prioritize()
+       void Prioritize() CXX11_OVERRIDE
        {
                // XXX: Load the DB here because the order in which modules are init()ed at boot is
                // alphabetical, this means we must wait until all modules have done their init()