2012-04-19 20:58:29 +02:00
|
|
|
/*
|
|
|
|
* InspIRCd -- Internet Relay Chat Daemon
|
2008-03-21 19:42:08 +00:00
|
|
|
*
|
2020-01-11 22:02:47 +00:00
|
|
|
* Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com>
|
2021-12-30 18:52:08 +00:00
|
|
|
* Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services>
|
2020-01-11 22:02:47 +00:00
|
|
|
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
|
|
|
|
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
|
|
|
|
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
|
|
|
|
* Copyright (C) 2008 Craig Edwards <brain@inspircd.org>
|
2008-03-21 19:42:08 +00:00
|
|
|
*
|
2012-04-19 20:58:29 +02: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.
|
2008-03-21 19:42:08 +00:00
|
|
|
*
|
2012-04-19 20:58:29 +02:00
|
|
|
* 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/>.
|
2008-03-21 19:42:08 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-19 20:58:29 +02:00
|
|
|
|
2013-04-02 20:12:15 +01:00
|
|
|
#pragma once
|
2008-03-21 19:42:08 +00:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
2015-02-11 16:46:11 +01:00
|
|
|
#include "event.h"
|
2008-03-21 19:42:08 +00:00
|
|
|
|
2009-10-14 18:39:38 +00:00
|
|
|
typedef StringExtItem AccountExtItem;
|
|
|
|
|
2010-02-09 02:22:36 +00:00
|
|
|
inline AccountExtItem* GetAccountExtItem()
|
2009-10-14 18:39:38 +00:00
|
|
|
{
|
|
|
|
return static_cast<AccountExtItem*>(ServerInstance->Extensions.GetItem("accountname"));
|
|
|
|
}
|
2015-02-11 16:46:11 +01:00
|
|
|
|
2020-02-21 09:01:48 +00:00
|
|
|
inline AccountExtItem* GetAccountIdExtItem()
|
|
|
|
{
|
|
|
|
return static_cast<AccountExtItem*>(ServerInstance->Extensions.GetItem("accountid"));
|
|
|
|
}
|
|
|
|
|
2015-02-11 16:46:11 +01:00
|
|
|
class AccountEventListener : public Events::ModuleEventListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AccountEventListener(Module* mod)
|
|
|
|
: ModuleEventListener(mod, "event/account")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Called when a user logs in or logs out
|
|
|
|
* @param user User logging in or out
|
|
|
|
* @param newaccount New account name of the user or empty string if the user
|
|
|
|
* logged out
|
|
|
|
*/
|
|
|
|
virtual void OnAccountChange(User* user, const std::string& newaccount) = 0;
|
|
|
|
};
|