* ---------------------------------------------------
*/
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "inspircd.h"
/* $ModDesc: Provides support for unreal-style channel mode +z */
CUList* userlist = channel->GetUsers();
for(CUList::iterator i = userlist->begin(); i != userlist->end(); i++)
{
- if(!i->second->GetExt("ssl", dummy))
+ if(!i->first->GetExt("ssl", dummy))
{
source->WriteServ("490 %s %s :all members of the channel must be connected via SSL", source->nick, channel->name);
return MODEACTION_DENY;
public:
ModuleSSLModes(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
sslm = new SSLMode(ServerInstance);
- ServerInstance->AddMode(sslm, 'z');
+ if (!ServerInstance->AddMode(sslm, 'z'))
+ throw ModuleException("Could not add new modes!");
}
void Implements(char* List)
else
{
// Deny
- user->WriteServ( "489 %s %s :Cannot join channel (+z)", user->nick, cname);
+ user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick, cname);
return 1;
}
}
};
-class ModuleSSLModesFactory : public ModuleFactory
-{
- public:
- ModuleSSLModesFactory()
- {
- }
-
- ~ModuleSSLModesFactory()
- {
- }
-
- virtual Module* CreateModule(InspIRCd* Me)
- {
- return new ModuleSSLModes(Me);
- }
-
-};
-
+MODULE_INIT(ModuleSSLModes);
-extern "C" void * init_module( void )
-{
- return new ModuleSSLModesFactory;
-}