diff options
Diffstat (limited to 'Swiften/Jingle/JingleSessionManager.cpp')
-rw-r--r-- | Swiften/Jingle/JingleSessionManager.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Swiften/Jingle/JingleSessionManager.cpp b/Swiften/Jingle/JingleSessionManager.cpp index e60449b..f9a94f3 100644 --- a/Swiften/Jingle/JingleSessionManager.cpp +++ b/Swiften/Jingle/JingleSessionManager.cpp @@ -7,6 +7,8 @@ #include <Swiften/Jingle/JingleSessionManager.h> #include <Swiften/Jingle/JingleResponder.h> #include <Swiften/Jingle/IncomingJingleSessionHandler.h> +#include <Swiften/Base/foreach.h> +#include <Swiften/Base/Algorithm.h> namespace Swift { @@ -18,9 +20,9 @@ JingleSessionManager::~JingleSessionManager() { delete responder; } -JingleSession::ref JingleSessionManager::getSession(const JID& jid, const std::string& id) const { +JingleSessionImpl::ref JingleSessionManager::getSession(const JID& jid, const std::string& id) const { SessionMap::const_iterator i = incomingSessions.find(JIDSession(jid, id)); - return i != incomingSessions.end() ? i->second : JingleSession::ref(); + return i != incomingSessions.end() ? i->second : JingleSessionImpl::ref(); } void JingleSessionManager::addIncomingSessionHandler(IncomingJingleSessionHandler* handler) { @@ -28,13 +30,13 @@ void JingleSessionManager::addIncomingSessionHandler(IncomingJingleSessionHandle } void JingleSessionManager::removeIncomingSessionHandler(IncomingJingleSessionHandler* handler) { - incomingSessionHandlers.erase(std::remove(incomingSessionHandlers.begin(), incomingSessionHandlers.end(), handler), incomingSessionHandlers.end()); + erase(incomingSessionHandlers, handler); } -void JingleSessionManager::handleIncomingSession(const JID& from, IncomingJingleSession::ref session) { +void JingleSessionManager::handleIncomingSession(const JID& from, JingleSessionImpl::ref session, const std::vector<JingleContentPayload::ref>& contents) { incomingSessions.insert(std::make_pair(JIDSession(from, session->getID()), session)); foreach (IncomingJingleSessionHandler* handler, incomingSessionHandlers) { - if (handler->handleIncomingJingleSession(session)) { + if (handler->handleIncomingJingleSession(session, contents)) { return; } } |