summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2014-08-21 08:38:11 (GMT)
committerKevin Smith <git@kismith.co.uk>2014-08-21 08:40:10 (GMT)
commit381b22fc365c27b9cd585f4b78f53ebc698d9f54 (patch)
tree0ffd89a8be13293c75c7ddfea524c74e0bf87b72 /Swiften/Jingle/JingleResponder.cpp
parent8ec22a9c5591584fd1725ed028d714c51b7509d3 (diff)
downloadswift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.zip
swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.tar.bz2
Clean up compilation errors in Swiften due to boost 1.56
Can no longer implicitly convert boost::optional to bool temporaries. Also fixed assorted uses of cerr where logging was appropriate. Test-Information: Swiften compiles against boost 1.56 (link fails for me so far) Change-Id: Iec058af933a82a987da64291435a475f8b40ef96
Diffstat (limited to 'Swiften/Jingle/JingleResponder.cpp')
-rw-r--r--Swiften/Jingle/JingleResponder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Jingle/JingleResponder.cpp b/Swiften/Jingle/JingleResponder.cpp
index 4c82f51..e963ef6 100644
--- a/Swiften/Jingle/JingleResponder.cpp
+++ b/Swiften/Jingle/JingleResponder.cpp
@@ -1,62 +1,62 @@
/*
- * Copyright (c) 2011 Remko Tronçon
+ * Copyright (c) 2011-2014 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Jingle/JingleResponder.h>
#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Jingle/JingleSessionManager.h>
#include <Swiften/Jingle/JingleSessionImpl.h>
#include <Swiften/Base/Log.h>
namespace Swift {
JingleResponder::JingleResponder(JingleSessionManager* sessionManager, IQRouter* router) : SetResponder<JinglePayload>(router), sessionManager(sessionManager), router(router) {
}
JingleResponder::~JingleResponder() {
}
bool JingleResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<JinglePayload> payload) {
if (payload->getAction() == JinglePayload::SessionInitiate) {
if (sessionManager->getSession(from, payload->getSessionID())) {
// TODO: Add tie-break error
sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel);
}
else {
sendResponse(from, id, boost::shared_ptr<JinglePayload>());
if (!payload->getInitiator().isBare()) {
JingleSessionImpl::ref session = boost::make_shared<JingleSessionImpl>(payload->getInitiator(), from, payload->getSessionID(), router);
sessionManager->handleIncomingSession(from, to, session, payload->getContents());
} else {
SWIFT_LOG(debug) << "Unable to create Jingle session due to initiator not being a full JID." << std::endl;
}
}
}
else {
JingleSessionImpl::ref session;
if (payload->getInitiator().isValid()) {
SWIFT_LOG(debug) << "Lookup session by initiator." << std::endl;
session = sessionManager->getSession(payload->getInitiator(), payload->getSessionID());
} else {
SWIFT_LOG(debug) << "Lookup session by from attribute." << std::endl;
session = sessionManager->getSession(from, payload->getSessionID());
}
if (session) {
session->handleIncomingAction(payload);
sendResponse(from, id, boost::shared_ptr<JinglePayload>());
}
else {
- std::cerr << "WARN: Didn't find jingle session!" << std::endl;
+ SWIFT_LOG(warning) << "Didn't find jingle session!";
// TODO: Add jingle-specific error
sendError(from, id, ErrorPayload::ItemNotFound, ErrorPayload::Cancel);
}
}
return true;
}
}