X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmode.h;h=84085a913a8d7ce40a1ed49f9d325620575582d4;hb=a3fb932831ca09b2a931616f1701ea39429356c2;hp=ac0c3135aaef74b3b3ea236e43a33ce639b7f47a;hpb=ffbd1eebf0b82bf40482879f410f58874030a695;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/mode.h b/include/mode.h index ac0c3135a..84085a913 100644 --- a/include/mode.h +++ b/include/mode.h @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -211,6 +211,10 @@ class CoreExport ModeHandler : public Extensible */ char GetModeChar(); + /** For user modes, return the current parameter, if any + */ + virtual std::string GetUserParameter(User* useor); + /** * Called when a mode change for your mode occurs. * @param source Contains the user setting the mode. @@ -232,6 +236,14 @@ class CoreExport ModeHandler : public Extensible */ virtual void DisplayList(User* user, Channel* channel); + /** In the event that the mode should be given a parameter, and no parameter was provided, this method is called. + * This allows you to give special information to the user, or handle this any way you like. + * @param user The user issuing the mode change + * @param dest For user mode changes, the target of the mode. For channel mode changes, NULL. + * @param channel For channel mode changes, the target of the mode. For user mode changes, NULL. + */ + virtual void OnParameterMissing(User* user, User* dest, Channel* channel); + /** * If your mode is a listmode, this method will be called to display an empty list (just the end of list numeric) * @param user The user issuing the command @@ -496,7 +508,6 @@ class CoreExport ModeParser : public classbase /** Process a set of mode changes from a server or user. * @param parameters The parameters of the mode change, in the format * they would be from a MODE command. - * @param pcnt The number of items in the parameters array * @param user The user setting or removing the modes. When the modes are set * by a server, an 'uninitialized' User is used, where *user::nick == NULL * and *user->server == NULL. @@ -533,9 +544,14 @@ class CoreExport ModeParser : public classbase */ std::string ParaModeList(); - /** Generates the CHANMODES= 005 sequence + /** Generates a list of modes, comma seperated by type: + * 1; Listmodes EXCEPT those with a prefix + * 2; Modes that take a param when adding or removing + * 3; Modes that only take a param when adding + * 4; Modes that dont take a param */ - std::string ChanModes(); + std::string GiveModeList(ModeMasks m); + /** Used by this class internally during std::sort and 005 generation */ static bool PrefixComparison(prefixtype one, prefixtype two);