summaryrefslogtreecommitdiffstats
blob: abf9412aa95d6a3d080a7b935032433557e149d3 (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 Isode Limited.
 * All rights reserved.
 * See the COPYING file 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());
}