#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
{
}
- 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);
if (target_type == TYPE_USER)
{
User* t = (User*)dest;
- if (!user->IsOper() && (t->IsModeSet(pm)) && (!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, "%s :You are not permitted to send private messages to this user (+c set)", t->nick.c_str());
return MOD_RES_DENY;
}
}