* ---------------------------------------------------
*/
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "inspircd.h"
/* $ModDesc: Allows for auditorium channels (+u) where nobody can see others joining and parting or the nick list */
CUList except_list;
public:
ModuleAuditorium(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
aum = new AuditoriumMode(ServerInstance);
if (!ServerInstance->AddMode(aum, 'u'))
Priority Prioritize()
{
/* To ensure that we get priority over namesx for names list generation on +u channels */
- return (Priority)ServerInstance->PriorityBefore("m_namesx.so");
+ return (Priority)ServerInstance->Modules->PriorityBefore("m_namesx.so");
}
virtual Version GetVersion()
/* Show all the opped users */
nl = *(Ptr->GetOppedUsers());
- nl[user] = user;
+ nl[user] = user->nick;
nameslist = &nl;
return 0;
}
else
{
/* HELLOOO, IS ANYBODY THERE? -- nope, just us. */
- user->WriteServ("353 %s = %s :%s", user->nick, Ptr->name, user->nick);
+ user->WriteServ("353 %s %c %s :%s", user->nick, Ptr->IsModeSet('s') ? '@' : Ptr->IsModeSet('p') ? '*' : '=', Ptr->name, user->nick);
user->WriteServ("366 %s %s :End of /NAMES list.", user->nick, Ptr->name);
return 1;
}
/* 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);
if (ShowOps)
- channel->WriteAllExcept(user, false, '@', except_list, "JOIN %s", channel->name);
+ channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name);
}
}
partmessage.empty() ? "" : " :",
partmessage.empty() ? "" : partmessage.c_str());
if (ShowOps)
- channel->WriteAllExcept(user, false, '@', except_list, "PART %s%s%s", channel->name, partmessage.empty() ? "" : " :",
+ {
+ channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name, partmessage.empty() ? "" : " :",
partmessage.empty() ? "" : partmessage.c_str());
+ }
}
}
/* Send silenced event only to the user being kicked and the user doing the kick */
source->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick, reason.c_str());
if (ShowOps)
- chan->WriteAllExcept(source, false, '@', except_list, "KICK %s %s %s", chan->name, user->nick, reason.c_str());
+ chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name, user->nick, reason.c_str());
else
user->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick, reason.c_str());
}
}
};
-class ModuleAuditoriumFactory : public ModuleFactory
-{
- public:
- ModuleAuditoriumFactory()
- {
- }
-
- ~ModuleAuditoriumFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleAuditorium(Me);
- }
-
-};
-
-extern "C" void * init_module( void )
-{
- return new ModuleAuditoriumFactory;
-}
-
+MODULE_INIT(ModuleAuditorium)