X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fchannels.cpp;h=c546e68db0e91180fe4afb1756f8ce143f0b19f6;hb=5ae804239ee1e2f8731b73ab37e9f16d8153d477;hp=3502abe1277ad6546d19647b84f2c175fbe99c66;hpb=1250abdc0915975f0a99cdcea1a4f6cb006b0a74;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index 3502abe12..c546e68db 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -116,16 +116,8 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset) } this->topic.assign(ntopic, 0, ServerInstance->Config->Limits.MaxTopic); - 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->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()); this->topicset = ServerInstance->Time(); @@ -673,7 +665,6 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList char tb[MAXBUF]; snprintf(tb,MAXBUF,":%s %s", serversource ? ServerInstance->Config->ServerName.c_str() : user->GetFullHost().c_str(), text.c_str()); - std::string out = tb; this->RawWriteAllExcept(user, serversource, status, except_list, std::string(tb)); } @@ -773,7 +764,9 @@ void Channel::UserList(User *user) if (!IS_LOCAL(user)) return; - if (this->IsModeSet('s') && !this->HasUser(user) && !user->HasPrivPermission("channels/auspex")) + bool has_privs = user->HasPrivPermission("channels/auspex"); + + if (this->IsModeSet('s') && !this->HasUser(user) && !has_privs) { user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str()); return; @@ -793,7 +786,7 @@ void Channel::UserList(User *user) { if (i->first->quitting) continue; - if ((!has_user) && (i->first->IsModeSet('i'))) + if ((!has_user) && (i->first->IsModeSet('i')) && (!has_privs)) { /* * user is +i, and source not on the channel, does not show