diff options
author | Peter Powell <petpow@saberuk.com> | 2018-12-09 04:28:20 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-12-09 04:28:20 +0000 |
commit | 9dab477dadb5d65be1eee584d37f1622b6a396c0 (patch) | |
tree | 39349b8c3c21add9e5089e3916ce09c10c0feea4 /include | |
parent | 94eb36566e0de00c158bcbdd57a5d372bb76b264 (diff) |
Allow modules to check if a user is on a callerid accept list.
Diffstat (limited to 'include')
-rw-r--r-- | include/modules/callerid.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/modules/callerid.h b/include/modules/callerid.h new file mode 100644 index 000000000..ed03419b0 --- /dev/null +++ b/include/modules/callerid.h @@ -0,0 +1,51 @@ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2018 Peter Powell <petpow@saberuk.com> + * + * 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 CallerID +{ + class APIBase; + class API; +} + +class CallerID::APIBase : public DataProvider +{ + public: + APIBase(Module* parent) + : DataProvider(parent, "m_callerid_api") + { + } + + /** Determines whether \p source is on the accept list of \p target. + * @param source The user to search for in the accept list. + * @param target The user who's accept list to search in. + * @return True if \p source is on \p target's accept list; otherwise, false. + */ + virtual bool IsOnAcceptList(User* source, User* target) = 0; +}; + +class CallerID::API : public dynamic_reference<CallerID::APIBase> +{ + public: + API(Module* parent) + : dynamic_reference<CallerID::APIBase>(parent, "m_callerid_api") + { + } +}; |