summaryrefslogtreecommitdiffstats
blob: 3ee78644c62397f2c2e020da6c512af3ac8a9f38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Copyright (c) 2011 Remko Tronçon
 * Licensed under the GNU General Public License v3.
 * See Documentation/Licenses/GPLv3.txt for more information.
 */

#include <Swiften/Client/BlockList.h>

#include <algorithm>

using namespace Swift;

BlockList::~BlockList() {

}

bool BlockList::isBlocked(const JID& jid) const {
	const std::vector<JID>& items = getItems();
	return (std::find(items.begin(), items.end(), jid.toBare()) != items.end()) ||
			(std::find(items.begin(), items.end(), JID(jid.getDomain())) != items.end()) ||
			(std::find(items.begin(), items.end(), jid) != items.end());
}