]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Only check for a join time if a user is actually in the channel.
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index 4bc9c2fadde6e422e58d90060d8a4e890bc53788..35736bf711e47670a9bc7a4408727758f5c499a2 100644 (file)
@@ -2,7 +2,7 @@
  * InspIRCd -- Internet Relay Chat Daemon
  *
  *   Copyright (C) 2014 Justin Crawford <Justasic@Gmail.com>
- *   Copyright (C) 2013-2014, 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013-2014, 2017-2021 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2013-2014, 2016 Attila Molnar <attilamolnar@hush.com>
  *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2012, 2014 Adam <Adam@anope.org>
@@ -77,7 +77,10 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list
                return false;
        }
 
-       stream << "# This file is automatically generated by m_permchannels. Any changes will be overwritten." << std::endl
+       stream
+               << "# This file was automatically generated by the " << INSPIRCD_VERSION << " permchannels module on " << InspIRCd::TimeString(ServerInstance->Time()) << "." << std::endl
+               << "# Any changes to this file will be automatically overwritten." << std::endl
+               << std::endl
                << "<config format=\"xml\">" << std::endl;
 
        const chan_hash& chans = ServerInstance->GetChans();
@@ -186,7 +189,7 @@ public:
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("permchanneldb");
                permchannelsconf = tag->getString("filename");
-               save_listmodes = tag->getBool("listmodes");
+               save_listmodes = tag->getBool("listmodes", true);
                SetInterval(tag->getDuration("saveperiod", 5));
 
                if (!permchannelsconf.empty())
@@ -228,7 +231,7 @@ public:
                                                topicset = ServerInstance->Time();
                                        std::string topicsetby = tag->getString("topicsetby");
                                        if (topicsetby.empty())
-                                               topicsetby = ServerInstance->Config->ServerName;
+                                               topicsetby = ServerInstance->Config->GetServerName();
                                        c->SetTopic(ServerInstance->FakeClient, topic, topicset, &topicsetby);
                                }