X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chancreate.cpp;h=5f04b4563e339046d83e16543af371c0f90bd111;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=48f60a8d91b91433ffe28a15cd57627ba8390994;hpb=3af9c3f8950f864bcf9cdd56127cd4014827dece;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp index 48f60a8d9..5f04b4563 100644 --- a/src/modules/m_chancreate.cpp +++ b/src/modules/m_chancreate.cpp @@ -25,13 +25,12 @@ class ModuleChanCreate : public Module { - private: public: - ModuleChanCreate() - { + void init() + { ServerInstance->SNO->EnableSnomask('j', "CHANCREATE"); Implementation eventlist[] = { I_OnUserJoin }; - ServerInstance->Modules->Attach(eventlist, this, 1); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } Version GetVersion() @@ -39,19 +38,11 @@ class ModuleChanCreate : public Module return Version("Provides snomasks 'j' and 'J', to which notices about newly created channels are sent",VF_VENDOR); } - void OnUserJoin(Membership* memb, bool sync, bool created, CUList& except) { - if (created) + if ((created) && (IS_LOCAL(memb->user))) { - if (IS_LOCAL(memb->user)) - ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", - memb->chan->name.c_str(), memb->user->nick.c_str(), - memb->user->ident.c_str(), memb->user->host.c_str()); - else - ServerInstance->SNO->WriteGlobalSno('J', "Channel %s created by %s!%s@%s", - memb->chan->name.c_str(), memb->user->nick.c_str(), - memb->user->ident.c_str(), memb->user->host.c_str()); + ServerInstance->SNO->WriteGlobalSno('j', "Channel %s created by %s", memb->chan->name.c_str(), memb->user->GetFullRealHost().c_str()); } } };