From 985c2bd1e6ea0bba467143406b83ba4a9f77fce1 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Aug 2008 16:16:49 +0000 Subject: Add OnParameterMissing to modehandler, called when the mode handler should have a parameter, but the parser found none git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10149 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 5 +++++ src/modes/umode_s.cpp | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index a530f2eca..7de334689 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -142,6 +142,10 @@ void ModeHandler::DisplayEmptyList(User*, Channel*) { } +void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel) +{ +} + bool ModeHandler::CheckTimeStamp(time_t theirs, time_t ours, const std::string&, const std::string&, Channel*) { return (ours < theirs); @@ -571,6 +575,7 @@ void ModeParser::Process(const std::vector& parameters, User *user, else { /* No parameter, continue to the next mode */ + modehandlers[handler_id]->OnParameterMissing(user, targetuser, targetchannel); continue; } diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp index 3a70161d5..dde0cb15d 100644 --- a/src/modes/umode_s.cpp +++ b/src/modes/umode_s.cpp @@ -51,3 +51,9 @@ ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Chan return MODEACTION_DENY; } +void ModeUserServerNoticeMask::OnParameterMissing(User* user, User* dest, Channel* channel) +{ + user->WriteServ("NOTICE %s :*** The user mode +s requires a parameter (server notice mask). Please provide a parameter, e.g. '+s +*'.", + user->nick.c_str()); +} + -- cgit v1.2.3