}
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();
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));
}
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;
{
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