X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=7374f091e80997f1abbe9d6939b5abfd90a7a3ab;hb=683055a13b0cb5c41556eaafef99af27edf1e868;hp=ac7c461d6e12377bb047bfa6fd3d2dbf84b56024;hpb=c16cda5d715241bb4bff8050bee942a8a34a72c0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index ac7c461d6..7374f091e 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -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) {