X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_user%2Fcore_user.h;h=befb07ef5862919d37c020c8b45ae4a45edc866f;hb=63345df39b6fdd44b462ec162dd6c4d99518b39c;hp=72ba67869069ae1f88d98daca5164c79d5a76d46;hpb=ccb6c0f243ee8de52677dface0a24878630bb7fd;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h index 72ba67869..befb07ef5 100644 --- a/src/coremods/core_user/core_user.h +++ b/src/coremods/core_user/core_user.h @@ -2,6 +2,9 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2014 Attila Molnar + * Copyright (C) 2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -20,6 +23,7 @@ #pragma once #include "inspircd.h" +#include "listmode.h" class MessageWrapper { @@ -58,8 +62,8 @@ class CommandAway : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const std::vector& parameters, User *user); - RouteDescriptor GetRouting(User* user, const std::vector& parameters); + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE; }; class CommandMode : public Command @@ -91,9 +95,9 @@ class CommandMode : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const std::vector& parameters, User* user); + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector& parameters); + RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE; }; /** Handle /NICK. @@ -110,7 +114,7 @@ class CommandNick : public SplitCommand * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult HandleLocal(const std::vector& parameters, LocalUser* user); + CmdResult HandleLocal(const std::vector& parameters, LocalUser* user) CXX11_OVERRIDE; }; /** Handle /PART. @@ -129,8 +133,8 @@ class CommandPart : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const std::vector& parameters, User *user); - RouteDescriptor GetRouting(User* user, const std::vector& parameters); + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE; + RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE; }; /** Handle /QUIT. @@ -152,9 +156,9 @@ class CommandQuit : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const std::vector& parameters, User*user); + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE; - RouteDescriptor GetRouting(User* user, const std::vector& parameters); + RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE; }; /** Handle /USER. @@ -171,7 +175,7 @@ class CommandUser : public SplitCommand * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult HandleLocal(const std::vector& parameters, LocalUser *user); + CmdResult HandleLocal(const std::vector& parameters, LocalUser* user) CXX11_OVERRIDE; /** Run the OnUserRegister hook if the user has sent both NICK and USER. Called after an unregistered user * successfully executes the USER or the NICK command. @@ -182,3 +186,37 @@ class CommandUser : public SplitCommand */ static CmdResult CheckRegister(LocalUser* user); }; + +/** User mode +s + */ +class ModeUserServerNoticeMask : public ModeHandler +{ + /** Process a snomask modifier string, e.g. +abc-de + * @param user The target user + * @param input A sequence of notice mask characters + * @return The cleaned mode sequence which can be output, + * e.g. in the above example if masks c and e are not + * valid, this function will return +ab-d + */ + std::string ProcessNoticeMasks(User* user, const std::string& input); + + public: + ModeUserServerNoticeMask(Module* Creator); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) CXX11_OVERRIDE; + void OnParameterMissing(User* user, User* dest, Channel* channel) CXX11_OVERRIDE; + + /** Create a displayable mode string of the snomasks set on a given user + * @param user The user whose notice masks to format + * @return The notice mask character sequence + */ + std::string GetUserParameter(const User* user) const CXX11_OVERRIDE; +}; + +/** User mode +o + */ +class ModeUserOperator : public ModeHandler +{ + public: + ModeUserOperator(Module* Creator); + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) CXX11_OVERRIDE; +};