2020-01-05 14:41:06 +00:00
|
|
|
/*
|
|
|
|
* InspIRCd -- Internet Relay Chat Daemon
|
|
|
|
*
|
2024-06-07 10:37:56 +01:00
|
|
|
* Copyright (C) 2020-2023 Sadie Powell <sadie@witchery.services>
|
2020-01-05 14:41:06 +00:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace ISupport
|
|
|
|
{
|
|
|
|
class EventListener;
|
|
|
|
class EventProvider;
|
2020-07-15 12:08:57 +01:00
|
|
|
|
|
|
|
/* A mapping of ISUPPORT tokens to their values. */
|
|
|
|
typedef std::map<std::string, std::string, irc::insensitive_swo> TokenMap;
|
2020-01-05 14:41:06 +00:00
|
|
|
}
|
|
|
|
|
2022-06-26 15:20:06 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
// From draft-brocklesby-irc-isupport-03.
|
|
|
|
RPL_ISUPPORT = 5,
|
|
|
|
};
|
|
|
|
|
2020-01-05 14:41:06 +00:00
|
|
|
class ISupport::EventListener
|
|
|
|
: public Events::ModuleEventListener
|
|
|
|
{
|
2022-01-25 13:59:42 +00:00
|
|
|
protected:
|
2023-02-27 20:19:57 +00:00
|
|
|
EventListener(Module* mod, unsigned int eventprio = DefaultPriority)
|
|
|
|
: ModuleEventListener(mod, "event/isupport", eventprio)
|
2020-01-05 14:41:06 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-01-25 13:59:42 +00:00
|
|
|
public:
|
2022-01-16 01:33:40 +00:00
|
|
|
virtual void OnBuildISupport(TokenMap& tokens) { }
|
2023-01-08 16:12:43 +00:00
|
|
|
virtual void OnBuildClassISupport(const std::shared_ptr<ConnectClass>& klass, TokenMap& tokens) { }
|
2020-01-05 14:41:06 +00:00
|
|
|
};
|
|
|
|
|
2021-12-20 20:00:03 +00:00
|
|
|
class ISupport::EventProvider final
|
2020-01-05 14:41:06 +00:00
|
|
|
: public Events::ModuleEventProvider
|
|
|
|
{
|
2022-01-25 13:59:42 +00:00
|
|
|
public:
|
2020-01-05 14:41:06 +00:00
|
|
|
EventProvider(Module* mod)
|
|
|
|
: Events::ModuleEventProvider(mod, "event/isupport")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|