]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Also use freenode's 470 numeric in m_banredirect.
[user/henk/code/inspircd.git] / src / channels.cpp
index ac7c461d6e12377bb047bfa6fd3d2dbf84b56024..7374f091e80997f1abbe9d6939b5abfd90a7a3ab 100644 (file)
@@ -74,7 +74,7 @@ std::string Channel::GetModeParameter(char mode)
 
 int Channel::SetTopic(User *u, std::string &ntopic, bool forceset)
 {
-       if (IS_LOCAL(u))
+       if (u && IS_LOCAL(u))
        {
                if(!forceset)
                {
@@ -102,11 +102,20 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset)
        }
 
        this->topic.assign(ntopic, 0, ServerInstance->Config->Limits.MaxTopic);
-       this->setby.assign(ServerInstance->Config->FullHostInTopic ? u->GetFullHost() : u->nick, 0, 128);
+       if (u)
+       {
+               this->setby.assign(ServerInstance->Config->FullHostInTopic ? u->GetFullHost() : u->nick, 0, 128);
+               this->WriteChannel(u, "TOPIC %s :%s", this->name.c_str(), this->topic.c_str());
+       }
+       else
+       {
+               this->setby.assign(ServerInstance->Config->ServerName);
+               this->WriteChannelWithServ(ServerInstance->Config->ServerName, "TOPIC %s :%s", this->name.c_str(), this->topic.c_str());
+       }
+
        this->topicset = ServerInstance->Time();
-       this->WriteChannel(u, "TOPIC %s :%s", this->name.c_str(), this->topic.c_str());
 
-       if (IS_LOCAL(u))
+       if (u && IS_LOCAL(u))
        {
                FOREACH_MOD(I_OnPostLocalTopicChange,OnPostLocalTopicChange(u, this, this->topic));
        }
@@ -267,7 +276,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                }
                else
                {
-                       if (IS_OPER(user))
+                       if (user->HasPrivPermission("channels/high-join-limit"))
                        {
                                if (user->chans.size() >= Instance->Config->OperMaxChans)
                                {
@@ -554,8 +563,6 @@ bool Channel::IsExtBanned(User *user, char type)
 /* Channel::PartUser
  * remove a channel from a users record, and return the number of users left.
  * Therefore, if this function returns 0 the caller should delete the Channel.
- *
- * XXX: bleh, string copy of reason, fixme! -- w00t
  */
 long Channel::PartUser(User *user, std::string &reason)
 {