summaryrefslogtreecommitdiff
path: root/include/modules/callerid.h
blob: eda930d2899fb05e9f64696fa35254a2fa9af29b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * InspIRCd -- Internet Relay Chat Daemon
 *
 *   Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
 *
 * 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")
	{
	}
};