X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_user%2Fcore_user.h;h=def399c72bded4304a7120b220849699a8d175e7;hb=c71361e8e4f22cb4f72881399bce2832eb080b0e;hp=f29d2e448b8b962e323a49f8c3c9c51e83df04d0;hpb=384ef31bc01e4a1a2e59d082c9066002410ba54a;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 f29d2e448..def399c72 100644 --- a/src/coremods/core_user/core_user.h +++ b/src/coremods/core_user/core_user.h @@ -1,10 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017-2020 Sadie Powell * 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 @@ -24,6 +22,13 @@ #include "inspircd.h" #include "listmode.h" +#include "modules/away.h" + +enum +{ + // From RFC 1459. + ERR_NOORIGIN = 409 +}; class MessageWrapper { @@ -53,6 +58,9 @@ class MessageWrapper */ class CommandAway : public Command { + private: + Away::EventProvider awayevprov; + public: /** Constructor for away. */ @@ -66,40 +74,28 @@ class CommandAway : public Command RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; }; -class CommandMode : public Command +/** Handle /ISON. + */ +class CommandIson : public SplitCommand { - unsigned int sent[256]; - unsigned int seq; - - /** Show the list of one or more list modes to a user. - * @param user User to send to. - * @param chan Channel whose lists to show. - * @param mode_sequence Mode letters to show the lists of. - */ - void DisplayListModes(User* user, Channel* chan, const std::string& mode_sequence); - - /** Show the current modes of a channel or a user to a user. - * @param user User to show the modes to. - * @param targetuser User whose modes to show. NULL if showing the modes of a channel. - * @param targetchannel Channel whose modes to show. NULL if showing the modes of a user. - */ - void DisplayCurrentModes(User* user, User* targetuser, Channel* targetchannel); - public: - /** Constructor for mode. - */ - CommandMode(Module* parent); - + /** Constructor for ison. + */ + CommandIson(Module* parent) + : SplitCommand(parent, "ISON", 1) + { + allow_empty_last_param = false; + syntax = " []+"; + } /** Handle command. * @param parameters The parameters to the command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; - - RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE; + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE; }; + /** Handle /NICK. */ class CommandNick : public SplitCommand @@ -187,6 +183,30 @@ class CommandUser : public SplitCommand static CmdResult CheckRegister(LocalUser* user); }; +/** Handle /USERHOST. + */ +class CommandUserhost : public Command +{ + UserModeReference hideopermode; + + public: + /** Constructor for userhost. + */ + CommandUserhost(Module* parent) + : Command(parent,"USERHOST", 1) + , hideopermode(parent, "hideoper") + { + allow_empty_last_param = false; + syntax = " []+"; + } + /** Handle command. + * @param parameters The parameters to the command + * @param user The user issuing the command + * @return A value from CmdResult to indicate command success or failure. + */ + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; +}; + /** User mode +s */ class ModeUserServerNoticeMask : public ModeHandler @@ -203,7 +223,6 @@ class ModeUserServerNoticeMask : public ModeHandler 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