diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-20 10:24:26 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-07-20 10:24:26 (GMT) |
commit | b4384bde09c72dde1620478c98fc20eb76529f3f (patch) | |
tree | 59a7bca1f9b8e77138cb0b28ae7848356f3252c8 /Swiften/Whiteboard | |
parent | edeab9429a996aa5641cfb9c4b3fc1386b49d81f (diff) | |
download | swift-contrib-b4384bde09c72dde1620478c98fc20eb76529f3f.zip swift-contrib-b4384bde09c72dde1620478c98fc20eb76529f3f.tar.bz2 |
Made compilation of whiteboard components warning free
Diffstat (limited to 'Swiften/Whiteboard')
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | 2 | ||||
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.h | 2 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardClient.cpp | 1 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardResponder.cpp | 2 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardResponder.h | 2 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardServer.cpp | 25 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.cpp | 32 |
7 files changed, 29 insertions, 37 deletions
diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index b3722ac..0c7bc42 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -28,7 +28,7 @@ namespace Swift { return "a"; } - void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> payload, ErrorPayload::ref error) { + void OutgoingWhiteboardSession::handleRequestResponse(boost::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error) { if (error) { onRequestRejected(toJID_); } diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.h b/Swiften/Whiteboard/OutgoingWhiteboardSession.h index 66b2d3f..149e483 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.h +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.h @@ -23,7 +23,7 @@ namespace Swift { std::string getClientID() const; private: - void handleRequestResponse(boost::shared_ptr<WhiteboardPayload> payload, ErrorPayload::ref error); + void handleRequestResponse(boost::shared_ptr<WhiteboardPayload> /*payload*/, ErrorPayload::ref error); void handleIncomingOperation(WhiteboardOperation::ref operation); void sendOperation(WhiteboardOperation::ref operation); diff --git a/Swiften/Whiteboard/WhiteboardClient.cpp b/Swiften/Whiteboard/WhiteboardClient.cpp index 70271e6..f8c677b 100644 --- a/Swiften/Whiteboard/WhiteboardClient.cpp +++ b/Swiften/Whiteboard/WhiteboardClient.cpp @@ -86,7 +86,6 @@ namespace Swift { if (bridge_.size() > 0 && (bridge_.front())->getParentID() == lastSentOperationID_) { lastSentOperationID_ = (bridge_.front())->getID(); result.server = bridge_.front(); - result.server->setOrigin(WhiteboardOperation::Other); } if (!result.server) { lastSentOperationID_.clear(); diff --git a/Swiften/Whiteboard/WhiteboardResponder.cpp b/Swiften/Whiteboard/WhiteboardResponder.cpp index c947aec..356356c 100644 --- a/Swiften/Whiteboard/WhiteboardResponder.cpp +++ b/Swiften/Whiteboard/WhiteboardResponder.cpp @@ -15,7 +15,7 @@ namespace Swift { WhiteboardResponder::WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router) : SetResponder<WhiteboardPayload>(router), sessionManager_(sessionManager), router_(router) { } - bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload) { + bool WhiteboardResponder::handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload) { if (payload->getType() == WhiteboardPayload::SessionRequest) { if (sessionManager_->getSession(from.toBare())) { sendError(from, id, ErrorPayload::Conflict, ErrorPayload::Cancel); diff --git a/Swiften/Whiteboard/WhiteboardResponder.h b/Swiften/Whiteboard/WhiteboardResponder.h index b171ef3..c05be23 100644 --- a/Swiften/Whiteboard/WhiteboardResponder.h +++ b/Swiften/Whiteboard/WhiteboardResponder.h @@ -16,7 +16,7 @@ namespace Swift { class WhiteboardResponder : public SetResponder<WhiteboardPayload> { public: WhiteboardResponder(WhiteboardSessionManager* sessionManager, IQRouter* router); - bool handleSetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload); + bool handleSetRequest(const JID& from, const JID& /*to*/, const std::string& id, boost::shared_ptr<WhiteboardPayload> payload); private: WhiteboardSessionManager* sessionManager_; diff --git a/Swiften/Whiteboard/WhiteboardServer.cpp b/Swiften/Whiteboard/WhiteboardServer.cpp index e84ddb3..53a131f 100644 --- a/Swiften/Whiteboard/WhiteboardServer.cpp +++ b/Swiften/Whiteboard/WhiteboardServer.cpp @@ -21,22 +21,17 @@ namespace Swift { for (it = operations_.rbegin(); it != operations_.rend(); ++it) { WhiteboardOperation::ref operation = *it; while (newOperation->getParentID() == operation->getParentID()) { -// WhiteboardInsertOperation::ref insertOperation = boost::dynamic_pointer_cast<WhiteboardInsertOperation>(operation); -// if (insertOperation) { - std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> tResult = WhiteboardTransformer::transform(newOperation, operation); + std::pair<WhiteboardOperation::ref, WhiteboardOperation::ref> tResult = WhiteboardTransformer::transform(newOperation, operation); + + if (it == operations_.rbegin()) { + operations_.push_back(tResult.second); + return tResult.second; + } else { + newOperation = tResult.second; + --it; + operation = *it; + } - if (it == operations_.rbegin()) { - operations_.push_back(tResult.second); - return tResult.second; - } else { - newOperation = tResult.second; - --it; - operation = *it; - } -// } else { -// operations_.push_back(operation); -// return *it; -// } } } return WhiteboardOperation::ref(); diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp index 492aec5..92865e3 100644 --- a/Swiften/Whiteboard/WhiteboardSession.cpp +++ b/Swiften/Whiteboard/WhiteboardSession.cpp @@ -20,20 +20,22 @@ namespace Swift { } void WhiteboardSession::handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload) { - if (payload->getType() == WhiteboardPayload::SessionTerminate) { - onSessionTerminateReceived(toJID_); - return; - } - switch (payload->getType()) { - case WhiteboardPayload::Data: - //onElementReceived(payload->getElement()); -// onOperationReceived(payload->getOperation()); - handleIncomingOperation(payload->getOperation()); - break; - case WhiteboardPayload::SessionAccept: - onRequestAccepted(toJID_); - break; + case WhiteboardPayload::Data: + handleIncomingOperation(payload->getOperation()); + return; + case WhiteboardPayload::SessionAccept: + onRequestAccepted(toJID_); + return; + case WhiteboardPayload::SessionTerminate: + onSessionTerminateReceived(toJID_); + return; + + //handled elsewhere + case WhiteboardPayload::SessionRequest: + + case WhiteboardPayload::UnknownType: + return; } } @@ -44,10 +46,6 @@ namespace Swift { request->send(); } -/* void WhiteboardSession::sendOperation(const WhiteboardOperation::ref operation) { - handleSendOperationRequest(operation); - }*/ - void WhiteboardSession::sendPayload(boost::shared_ptr<WhiteboardPayload> payload) { boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); request->send(); |