X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fcommands.h;h=dd54b5b6bd2bad3117d6d9690be544751ad3fb5e;hb=e9e75e50bc25e67af22dd88b39b12217a553d5cb;hp=358acaa293327cd23e554d1d02759b1b964fca76;hpb=9ebd9cba72056c5b36696e166826afb981f25ebb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h index 358acaa29..dd54b5b6b 100644 --- a/src/modules/m_spanningtree/commands.h +++ b/src/modules/m_spanningtree/commands.h @@ -1,18 +1,23 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2010 Daniel De Graaf * - * This program is free but copyrighted software; see - * the file COPYING for details. + * 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 + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -#ifndef M_SPANNINGTREE_COMMANDS_H -#define M_SPANNINGTREE_COMMANDS_H + +#pragma once #include "main.h" @@ -34,7 +39,6 @@ class CommandRSQuit : public Command CommandRSQuit(Module* Callback, SpanningTreeUtilities* Util); CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters); - void NoticeUser(User* user, const std::string &msg); }; class CommandSVSJoin : public Command @@ -54,7 +58,7 @@ class CommandSVSPart : public Command class CommandSVSNick : public Command { public: - CommandSVSNick(Module* Creator) : Command(Creator, "SVSNICK", 2) { flags_needed = FLAG_SERVERONLY; } + CommandSVSNick(Module* Creator) : Command(Creator, "SVSNICK", 3) { flags_needed = FLAG_SERVERONLY; } CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters); }; @@ -79,16 +83,19 @@ class CommandOpertype : public Command CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters) { return ROUTE_BROADCAST; } }; +class TreeSocket; class CommandFJoin : public Command { + /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes. + * This does not update the timestamp of the target channel, this must be done seperately. + */ + static void RemoveStatus(Channel* c); + static void ApplyModeStack(User* srcuser, Channel* c, irc::modestacker& stack); + bool ProcessModeUUIDPair(const std::string& item, TreeSocket* src_socket, Channel* chan, irc::modestacker* modestack); public: CommandFJoin(Module* Creator) : Command(Creator, "FJOIN", 3) { flags_needed = FLAG_SERVERONLY; } CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters) { return ROUTE_BROADCAST; } - /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes. - * This does not update the timestamp of the target channel, this must be done seperately. - */ - void RemoveStatus(User* source, parameterlist ¶ms); }; class CommandFMode : public Command { @@ -100,7 +107,7 @@ class CommandFMode : public Command class CommandFTopic : public Command { public: - CommandFTopic(Module* Creator) : Command(Creator, "FTOPIC", 4) { flags_needed = FLAG_SERVERONLY; } + CommandFTopic(Module* Creator) : Command(Creator, "FTOPIC", 5) { flags_needed = FLAG_SERVERONLY; } CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters) { return ROUTE_BROADCAST; } }; @@ -126,6 +133,21 @@ class CommandFName : public Command RouteDescriptor GetRouting(User* user, const std::vector& parameters) { return ROUTE_BROADCAST; } }; +class CommandIJoin : public SplitCommand +{ + public: + CommandIJoin(Module* Creator) : SplitCommand(Creator, "IJOIN", 1) { flags_needed = FLAG_SERVERONLY; } + CmdResult HandleRemote(const std::vector& parameters, RemoteUser* user); + RouteDescriptor GetRouting(User* user, const std::vector& parameters) { return ROUTE_BROADCAST; } +}; + +class CommandResync : public SplitCommand +{ + public: + CommandResync(Module* Creator) : SplitCommand(Creator, "RESYNC", 1) { flags_needed = FLAG_SERVERONLY; } + CmdResult HandleServer(const std::vector& parameters, FakeUser* user); +}; + class SpanningTreeCommands { public: @@ -138,6 +160,8 @@ class SpanningTreeCommands CommandUID uid; CommandOpertype opertype; CommandFJoin fjoin; + CommandIJoin ijoin; + CommandResync resync; CommandFMode fmode; CommandFTopic ftopic; CommandFHost fhost; @@ -145,5 +169,3 @@ class SpanningTreeCommands CommandFName fname; SpanningTreeCommands(ModuleSpanningTree* module); }; - -#endif