AuditoriumMode* aum;
bool ShowOps;
bool OperOverride;
- CUList nl;
- CUList except_list;
public:
ModuleAuditorium(InspIRCd* Me)
: Module(Me)
return;
/* If user is oper and operoverride is on, don't touch the list */
- if (OperOverride && user->HasPrivPermission("channels/auspex"))
+ if (OperOverride && issuer->HasPrivPermission("channels/auspex"))
return;
if (ShowOps && (issuer != user) && (channel->GetStatus(user) < STATUS_OP))
}
}
+ void WriteOverride(User* source, Channel* channel, const std::string &text)
+ {
+ if (!OperOverride)
+ return;
+
+ CUList *ulist = channel->GetUsers();
+ for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
+ {
+ if (i->first->HasPrivPermission("channels/auspex") && source != i->first)
+ if (!ShowOps || (ShowOps && channel->GetStatus(i->first) < STATUS_OP))
+ i->first->WriteFrom(source, "%s",text.c_str());
+ }
+ }
+
virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
if (channel->IsModeSet('u'))
/* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */
user->WriteFrom(user, "JOIN %s", channel->name.c_str());
if (ShowOps)
- channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name.c_str());
+ channel->WriteAllExceptSender(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', "JOIN %s", channel->name.c_str());
+ WriteOverride(user, channel, "JOIN "+channel->name);
}
}
partmessage.empty() ? "" : partmessage.c_str());
if (ShowOps)
{
- channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :",
+ channel->WriteAllExceptSender(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :",
partmessage.empty() ? "" : partmessage.c_str());
}
+ WriteOverride(user, channel, "PART " + channel->name + (partmessage.empty() ? "" : (" :" + partmessage)));
}
}
/* Send silenced event only to the user being kicked and the user doing the kick */
source->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
if (ShowOps)
- chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
- else
+ chan->WriteAllExceptSender(source, false, chan->GetStatus(user) >= STATUS_OP ? 0 : '@', "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
+ if ((!ShowOps) || (chan->GetStatus(user) < STATUS_OP)) /* make sure the target gets the event */
user->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
+ WriteOverride(source, chan, "KICK " + chan->name + " " + user->nick + " " + reason);
}
}