X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_commonchans.cpp;h=e04217e71f16d42ff45bb74bee97f78b4d0713d1;hb=f9fd78c01623514a060c607534fc52cb73140200;hp=d9ab030539e32c9fe3ca965acfd86e84d5a733b5;hpb=d9d99cd02dadf34bfcc220734ba0c422f0acb3e6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp index d9ab03053..e04217e71 100644 --- a/src/modules/m_commonchans.cpp +++ b/src/modules/m_commonchans.cpp @@ -19,8 +19,6 @@ #include "inspircd.h" -/* $ModDesc: Adds user mode +c, which if set, users must be on a common channel with you to private message you */ - /** Handles user mode +c */ class PrivacyMode : public SimpleUserModeHandler @@ -37,12 +35,6 @@ class ModulePrivacyMode : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(pm); - ServerInstance->Modules->Attach(I_OnUserPreMessage, this); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Adds user mode +c, which if set, users must be on a common channel with you to private message you", VF_VENDOR); @@ -53,9 +45,9 @@ class ModulePrivacyMode : public Module if (target_type == TYPE_USER) { User* t = (User*)dest; - if (!user->IsOper() && (t->IsModeSet('c')) && (!ServerInstance->ULine(user->server)) && !user->SharesChannelWith(t)) + if (!user->IsOper() && (t->IsModeSet(pm)) && (!user->server->IsULine()) && !user->SharesChannelWith(t)) { - user->WriteNumeric(ERR_CANTSENDTOUSER, "%s %s :You are not permitted to send private messages to this user (+c set)", user->nick.c_str(), t->nick.c_str()); + user->WriteNumeric(ERR_CANTSENDTOUSER, t->nick, "You are not permitted to send private messages to this user (+c set)"); return MOD_RES_DENY; } }