blob: f78930016b19e567e9ad1f22e31c664bf6a33b14 (
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
|
#include "MUCBookmarkManager.h"
#include "Swiften/Queries/IQRouter.h"
namespace Swift {
MUCBookmarkManager::MUCBookmarkManager(IQRouter* iqRouter) {
iqRouter_ = iqRouter;
}
void MUCBookmarkManager::addBookmark(boost::shared_ptr<MUCBookmark> bookmark) {
bookmarks_.push_back(bookmark);
flush();
}
void MUCBookmarkManager::removeBookmark(boost::shared_ptr<MUCBookmark> bookmark) {
std::vector<boost::shared_ptr<MUCBookmark> >::iterator it;
for (it = bookmarks_.begin(); it != bookmarks_.end(); it++) {
if ((*it).get() == bookmark.get()) {
bookmarks_.erase(it);
return;
}
}
assert(false);
flush();
}
void MUCBookmarkManager::flush() {
//FIXME: some code may be useful
}
const std::vector<boost::shared_ptr<MUCBookmark> >& MUCBookmarkManager::getBookmarks() {
return bookmarks_;
}
}
|