X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_restrictmsg.cpp;h=16a9bae86219be37ee8511b934c0d3f56adfc75b;hb=3d0d64933da3d37866fadfa042e34a1125315db6;hp=279775d480570621bb58a9f3464c390271a0d0b7;hpb=06bc8df45045a3d1fdc45f793abf7ba72b7403b1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index 279775d48..16a9bae86 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -24,11 +24,11 @@ class ModuleRestrictMsg : public Module { public: - ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE { - if ((target_type == TYPE_USER) && (IS_LOCAL(user))) + if ((target.type == MessageTarget::TYPE_USER) && (IS_LOCAL(user))) { - User* u = (User*)dest; + User* u = target.Get(); // message allowed if: // (1) the sender is opered @@ -39,7 +39,7 @@ class ModuleRestrictMsg : public Module { return MOD_RES_PASSTHRU; } - user->WriteNumeric(ERR_CANTSENDTOUSER, "%s :You are not permitted to send private messages to this user", u->nick.c_str()); + user->WriteNumeric(ERR_CANTSENDTOUSER, u->nick, "You are not permitted to send private messages to this user"); return MOD_RES_DENY; }