summaryrefslogtreecommitdiffstats
blob: cb77080d7d5f326a12e2d2cf74907af8b23d6c7b (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());
}