diff options
Diffstat (limited to 'Swiften/Roster')
-rw-r--r-- | Swiften/Roster/GetRosterRequest.h | 4 | ||||
-rw-r--r-- | Swiften/Roster/RosterMemoryStorage.cpp | 8 | ||||
-rw-r--r-- | Swiften/Roster/RosterMemoryStorage.h | 8 | ||||
-rw-r--r-- | Swiften/Roster/RosterPushResponder.h | 6 | ||||
-rw-r--r-- | Swiften/Roster/RosterStorage.h | 8 | ||||
-rw-r--r-- | Swiften/Roster/SetRosterRequest.h | 8 | ||||
-rw-r--r-- | Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp | 76 | ||||
-rw-r--r-- | Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp | 3 | ||||
-rw-r--r-- | Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h | 3 | ||||
-rw-r--r-- | Swiften/Roster/XMPPRosterController.cpp | 8 | ||||
-rw-r--r-- | Swiften/Roster/XMPPRosterController.h | 5 |
11 files changed, 68 insertions, 69 deletions
diff --git a/Swiften/Roster/GetRosterRequest.h b/Swiften/Roster/GetRosterRequest.h index 6ca16cb..1a0499f 100644 --- a/Swiften/Roster/GetRosterRequest.h +++ b/Swiften/Roster/GetRosterRequest.h @@ -13,7 +13,7 @@ namespace Swift { class SWIFTEN_API GetRosterRequest : public GenericRequest<RosterPayload> { public: - typedef boost::shared_ptr<GetRosterRequest> ref; + typedef std::shared_ptr<GetRosterRequest> ref; static ref create(IQRouter* router) { return ref(new GetRosterRequest(router)); @@ -27,7 +27,7 @@ namespace Swift { private: GetRosterRequest(IQRouter* router) : - GenericRequest<RosterPayload>(IQ::Get, JID(), boost::shared_ptr<Payload>(new RosterPayload()), router) { + GenericRequest<RosterPayload>(IQ::Get, JID(), std::make_shared<RosterPayload>(), router) { } }; } diff --git a/Swiften/Roster/RosterMemoryStorage.cpp b/Swiften/Roster/RosterMemoryStorage.cpp index f187116..1b72a85 100644 --- a/Swiften/Roster/RosterMemoryStorage.cpp +++ b/Swiften/Roster/RosterMemoryStorage.cpp @@ -1,22 +1,22 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Roster/RosterMemoryStorage.h> -#include <boost/smart_ptr/make_shared.hpp> +#include <memory> namespace Swift { RosterMemoryStorage::RosterMemoryStorage() { } -void RosterMemoryStorage::setRoster(boost::shared_ptr<RosterPayload> r) { +void RosterMemoryStorage::setRoster(std::shared_ptr<RosterPayload> r) { roster.reset(); if (r) { - roster = boost::make_shared<RosterPayload>(*r); + roster = std::make_shared<RosterPayload>(*r); } } diff --git a/Swiften/Roster/RosterMemoryStorage.h b/Swiften/Roster/RosterMemoryStorage.h index 4058f84..19e7802 100644 --- a/Swiften/Roster/RosterMemoryStorage.h +++ b/Swiften/Roster/RosterMemoryStorage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -14,13 +14,13 @@ namespace Swift { public: RosterMemoryStorage(); - virtual boost::shared_ptr<RosterPayload> getRoster() const { + virtual std::shared_ptr<RosterPayload> getRoster() const { return roster; } - virtual void setRoster(boost::shared_ptr<RosterPayload>); + virtual void setRoster(std::shared_ptr<RosterPayload>); private: - boost::shared_ptr<RosterPayload> roster; + std::shared_ptr<RosterPayload> roster; }; } diff --git a/Swiften/Roster/RosterPushResponder.h b/Swiften/Roster/RosterPushResponder.h index 06ba797..10986f5 100644 --- a/Swiften/Roster/RosterPushResponder.h +++ b/Swiften/Roster/RosterPushResponder.h @@ -17,13 +17,13 @@ namespace Swift { RosterPushResponder(IQRouter* router) : SetResponder<RosterPayload>(router) {} public: - boost::signal<void (boost::shared_ptr<RosterPayload>)> onRosterReceived; + boost::signal<void (std::shared_ptr<RosterPayload>)> onRosterReceived; private: - virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, boost::shared_ptr<RosterPayload> payload) { + virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr<RosterPayload> payload) { if (getIQRouter()->isAccountJID(from)) { onRosterReceived(payload); - sendResponse(from, id, boost::shared_ptr<RosterPayload>()); + sendResponse(from, id, std::shared_ptr<RosterPayload>()); } else { sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel); diff --git a/Swiften/Roster/RosterStorage.h b/Swiften/Roster/RosterStorage.h index 92c40f9..1c1461d 100644 --- a/Swiften/Roster/RosterStorage.h +++ b/Swiften/Roster/RosterStorage.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <Swiften/Base/API.h> #include <Swiften/Elements/RosterPayload.h> @@ -16,7 +16,7 @@ namespace Swift { public: virtual ~RosterStorage(); - virtual boost::shared_ptr<RosterPayload> getRoster() const = 0; - virtual void setRoster(boost::shared_ptr<RosterPayload>) = 0; + virtual std::shared_ptr<RosterPayload> getRoster() const = 0; + virtual void setRoster(std::shared_ptr<RosterPayload>) = 0; }; } diff --git a/Swiften/Roster/SetRosterRequest.h b/Swiften/Roster/SetRosterRequest.h index 64c0984..7615abc 100644 --- a/Swiften/Roster/SetRosterRequest.h +++ b/Swiften/Roster/SetRosterRequest.h @@ -6,7 +6,7 @@ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <Swiften/Base/API.h> #include <Swiften/Base/boost_bsignals.h> @@ -16,7 +16,7 @@ namespace Swift { class SWIFTEN_API SetRosterRequest : public Request { public: - typedef boost::shared_ptr<SetRosterRequest> ref; + typedef std::shared_ptr<SetRosterRequest> ref; static ref create(RosterPayload::ref payload, IQRouter* router) { return ref(new SetRosterRequest(JID(), payload, router)); @@ -27,10 +27,10 @@ namespace Swift { } private: - SetRosterRequest(const JID& to, boost::shared_ptr<RosterPayload> payload, IQRouter* router) : Request(IQ::Set, to, boost::shared_ptr<RosterPayload>(payload), router) { + SetRosterRequest(const JID& to, std::shared_ptr<RosterPayload> payload, IQRouter* router) : Request(IQ::Set, to, std::shared_ptr<RosterPayload>(payload), router) { } - virtual void handleResponse(boost::shared_ptr<Payload> /*payload*/, ErrorPayload::ref error) { + virtual void handleResponse(std::shared_ptr<Payload> /*payload*/, ErrorPayload::ref error) { onResponse(error); } diff --git a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp index 6850c21..b646aba 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp +++ b/Swiften/Roster/UnitTest/XMPPRosterControllerTest.cpp @@ -4,7 +4,7 @@ * See the COPYING file for more information. */ -#include <boost/smart_ptr/make_shared.hpp> +#include <memory> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> @@ -61,10 +61,10 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_Response() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->requestRoster(); - boost::shared_ptr<RosterPayload> payload = boost::make_shared<RosterPayload>(); + std::shared_ptr<RosterPayload> payload = std::make_shared<RosterPayload>(); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); payload->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), payload)); @@ -79,13 +79,13 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { controller.requestRoster(); - channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>())); + channel_->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>())); } void testAdd() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr<RosterPayload> payload(new RosterPayload()); + std::shared_ptr<RosterPayload> payload(new RosterPayload()); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "eou", payload)); @@ -97,65 +97,65 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_NoRosterInStorage() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); testling->requestRoster(); - boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); + std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion()); } void testGet_NoVersionInStorage() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); - rosterStorage_->setRoster(boost::make_shared<RosterPayload>()); + rosterStorage_->setRoster(std::make_shared<RosterPayload>()); testling->requestRoster(); - boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); + std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string(""), *roster->getVersion()); } void testGet_VersionInStorage() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr<RosterPayload> payload(new RosterPayload()); + std::shared_ptr<RosterPayload> payload(new RosterPayload()); payload->setVersion("foover"); rosterStorage_->setRoster(payload); testling->requestRoster(); - boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); + std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); CPPUNIT_ASSERT(roster->getVersion()); CPPUNIT_ASSERT_EQUAL(std::string("foover"), *roster->getVersion()); } void testGet_ServerDoesNotSupportVersion() { - boost::shared_ptr<XMPPRosterController> testling(createController()); - boost::shared_ptr<RosterPayload> payload(new RosterPayload()); + std::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<RosterPayload> payload(new RosterPayload()); payload->setVersion("foover"); rosterStorage_->setRoster(payload); testling->requestRoster(); - boost::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); + std::shared_ptr<RosterPayload> roster = channel_->sentStanzas[0]->getPayload<RosterPayload>(); CPPUNIT_ASSERT(!roster->getVersion()); } void testGet_ResponseWithoutNewVersion() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); + std::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>())); + channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>())); CPPUNIT_ASSERT_EQUAL(2, handler_->getEventCount()); CPPUNIT_ASSERT(xmppRoster_->getItem(jid1_)); @@ -170,15 +170,15 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testGet_ResponseWithNewVersion() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); + std::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - boost::shared_ptr<RosterPayload> serverRoster(new RosterPayload()); + std::shared_ptr<RosterPayload> serverRoster(new RosterPayload()); serverRoster->setVersion("version12"); serverRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); std::vector<std::string> groups; @@ -204,9 +204,9 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testAddFromNonAccount() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); - boost::shared_ptr<RosterPayload> payload(new RosterPayload()); + std::shared_ptr<RosterPayload> payload(new RosterPayload()); payload->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); IQ::ref request = IQ::createRequest(IQ::Set, JID(), "eou", payload); request->setFrom(jid2_); @@ -217,7 +217,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testModify() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr<RosterPayload> payload1(new RosterPayload()); + std::shared_ptr<RosterPayload> payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -225,7 +225,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload2(new RosterPayload()); + std::shared_ptr<RosterPayload> payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid1_, "Bob2", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -237,7 +237,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testRemove() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr<RosterPayload> payload1(new RosterPayload()); + std::shared_ptr<RosterPayload> payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -245,7 +245,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload2(new RosterPayload()); + std::shared_ptr<RosterPayload> payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_)); @@ -255,17 +255,17 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { } void testRemove_RosterStorageUpdated() { - boost::shared_ptr<XMPPRosterController> testling(createController()); + std::shared_ptr<XMPPRosterController> testling(createController()); testling->setUseVersioning(true); - boost::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); + std::shared_ptr<RosterPayload> storedRoster(new RosterPayload()); storedRoster->setVersion("version10"); storedRoster->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); storedRoster->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); rosterStorage_->setRoster(storedRoster); testling->requestRoster(); - channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), boost::shared_ptr<RosterPayload>())); + channel_->onIQReceived(IQ::createResult("foo@bar.com", channel_->sentStanzas[0]->getID(), std::shared_ptr<RosterPayload>())); - boost::shared_ptr<RosterPayload> payload2(new RosterPayload()); + std::shared_ptr<RosterPayload> payload2(new RosterPayload()); payload2->setVersion("version15"); payload2->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -279,7 +279,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { void testMany() { XMPPRosterController controller(router_, xmppRoster_, rosterStorage_); - boost::shared_ptr<RosterPayload> payload1(new RosterPayload()); + std::shared_ptr<RosterPayload> payload1(new RosterPayload()); payload1->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id1", payload1)); @@ -287,7 +287,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload2(new RosterPayload()); + std::shared_ptr<RosterPayload> payload2(new RosterPayload()); payload2->addItem(RosterItemPayload(jid2_, "Alice", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id2", payload2)); @@ -295,7 +295,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid2_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload3(new RosterPayload()); + std::shared_ptr<RosterPayload> payload3(new RosterPayload()); payload3->addItem(RosterItemPayload(jid1_, "Ernie", RosterItemPayload::Both)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id3", payload3)); @@ -303,7 +303,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload4(new RosterPayload()); + std::shared_ptr<RosterPayload> payload4(new RosterPayload()); RosterItemPayload item(jid3_, "Jane", RosterItemPayload::Both); std::string janesGroup("Jane's Group"); item.addGroup(janesGroup); @@ -316,7 +316,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(janesGroup, xmppRoster_->getGroupsForJID(jid3_)[0]); handler_->reset(); - boost::shared_ptr<RosterPayload> payload5(new RosterPayload()); + std::shared_ptr<RosterPayload> payload5(new RosterPayload()); payload5->addItem(RosterItemPayload(jid1_, "Bob", RosterItemPayload::Remove)); channel_->onIQReceived(IQ::createRequest(IQ::Set, JID(), "id5", payload5)); CPPUNIT_ASSERT(!xmppRoster_->containsJID(jid1_)); @@ -324,7 +324,7 @@ class XMPPRosterControllerTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(jid1_, handler_->getLastJID()); handler_->reset(); - boost::shared_ptr<RosterPayload> payload6(new RosterPayload()); + std::shared_ptr<RosterPayload> payload6(new RosterPayload()); RosterItemPayload item2(jid2_, "Little Alice", RosterItemPayload::Both); std::string alicesGroup("Alice's Group"); item2.addGroup(alicesGroup); diff --git a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp index f611fec..f0d92e9 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp +++ b/Swiften/Roster/UnitTest/XMPPRosterImplTest.cpp @@ -4,8 +4,9 @@ * See the COPYING file for more information. */ +#include <memory> + #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> diff --git a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h index 9c9afad..0535578 100644 --- a/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h +++ b/Swiften/Roster/UnitTest/XMPPRosterSignalHandler.h @@ -6,10 +6,9 @@ #pragma once +#include <memory> #include <vector> -#include <boost/shared_ptr.hpp> - #include <Swiften/Roster/XMPPRosterImpl.h> enum XMPPRosterEvents {None, Add, Remove, Update}; diff --git a/Swiften/Roster/XMPPRosterController.cpp b/Swiften/Roster/XMPPRosterController.cpp index 10803f3..b5e72f5 100644 --- a/Swiften/Roster/XMPPRosterController.cpp +++ b/Swiften/Roster/XMPPRosterController.cpp @@ -23,7 +23,7 @@ namespace Swift { * The controller does not gain ownership of these parameters. */ XMPPRosterController::XMPPRosterController(IQRouter* iqRouter, XMPPRosterImpl* xmppRoster, RosterStorage* rosterStorage) : iqRouter_(iqRouter), rosterPushResponder_(iqRouter), xmppRoster_(xmppRoster), rosterStorage_(rosterStorage), useVersioning(false) { - rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, boost::shared_ptr<RosterPayload>())); + rosterPushResponder_.onRosterReceived.connect(boost::bind(&XMPPRosterController::handleRosterReceived, this, _1, false, std::shared_ptr<RosterPayload>())); rosterPushResponder_.start(); } @@ -34,7 +34,7 @@ XMPPRosterController::~XMPPRosterController() { void XMPPRosterController::requestRoster() { xmppRoster_->clear(); - boost::shared_ptr<RosterPayload> storedRoster = rosterStorage_->getRoster(); + std::shared_ptr<RosterPayload> storedRoster = rosterStorage_->getRoster(); GetRosterRequest::ref rosterRequest; if (useVersioning) { std::string version = ""; @@ -50,7 +50,7 @@ void XMPPRosterController::requestRoster() { rosterRequest->send(); } -void XMPPRosterController::handleRosterReceived(boost::shared_ptr<RosterPayload> rosterPayload, bool initial, boost::shared_ptr<RosterPayload> previousRoster) { +void XMPPRosterController::handleRosterReceived(std::shared_ptr<RosterPayload> rosterPayload, bool initial, std::shared_ptr<RosterPayload> previousRoster) { if (rosterPayload) { foreach(const RosterItemPayload& item, rosterPayload->getItems()) { //Don't worry about the updated case, the XMPPRoster sorts that out. @@ -82,7 +82,7 @@ void XMPPRosterController::handleRosterReceived(boost::shared_ptr<RosterPayload> void XMPPRosterController::saveRoster(const std::string& version) { std::vector<XMPPRosterItem> items = xmppRoster_->getItems(); - boost::shared_ptr<RosterPayload> roster(new RosterPayload()); + std::shared_ptr<RosterPayload> roster(new RosterPayload()); roster->setVersion(version); foreach(const XMPPRosterItem& item, items) { roster->addItem(RosterItemPayload(item.getJID(), item.getName(), item.getSubscription(), item.getGroups())); diff --git a/Swiften/Roster/XMPPRosterController.h b/Swiften/Roster/XMPPRosterController.h index d40ba1e..3803cd5 100644 --- a/Swiften/Roster/XMPPRosterController.h +++ b/Swiften/Roster/XMPPRosterController.h @@ -6,10 +6,9 @@ #pragma once +#include <memory> #include <string> -#include <boost/shared_ptr.hpp> - #include <Swiften/Base/API.h> #include <Swiften/Base/boost_bsignals.h> #include <Swiften/Elements/IQ.h> @@ -34,7 +33,7 @@ namespace Swift { } private: - void handleRosterReceived(boost::shared_ptr<RosterPayload> rosterPayload, bool initial, boost::shared_ptr<RosterPayload> previousRoster); + void handleRosterReceived(std::shared_ptr<RosterPayload> rosterPayload, bool initial, std::shared_ptr<RosterPayload> previousRoster); void saveRoster(const std::string& version); private: |