summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Whiteboard/IncomingWhiteboardSession.cpp')
-rw-r--r--Swiften/Whiteboard/IncomingWhiteboardSession.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
index 4708bfa..206e10b 100644
--- a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
+++ b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp
@@ -20,46 +20,46 @@
#include <Swiften/Elements/WhiteboardPayload.h>
namespace Swift {
- IncomingWhiteboardSession::IncomingWhiteboardSession(const JID& jid, IQRouter* router) : WhiteboardSession(jid, router) {
- }
+ IncomingWhiteboardSession::IncomingWhiteboardSession(const JID& jid, IQRouter* router) : WhiteboardSession(jid, router) {
+ }
- IncomingWhiteboardSession::~IncomingWhiteboardSession() {
- }
+ IncomingWhiteboardSession::~IncomingWhiteboardSession() {
+ }
- void IncomingWhiteboardSession::accept() {
- boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionAccept);
- boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
- request->send();
- onRequestAccepted(toJID_);
- }
+ void IncomingWhiteboardSession::accept() {
+ boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionAccept);
+ boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_);
+ request->send();
+ onRequestAccepted(toJID_);
+ }
- void IncomingWhiteboardSession::handleIncomingOperation(WhiteboardOperation::ref operation) {
- WhiteboardClient::Result pairResult = client.handleServerOperationReceived(operation);
- if (pairResult.client) {
- if (pairResult.client->getPos() != -1) {
- onOperationReceived(pairResult.client);
- }
- lastOpID = pairResult.client->getID();
- }
+ void IncomingWhiteboardSession::handleIncomingOperation(WhiteboardOperation::ref operation) {
+ WhiteboardClient::Result pairResult = client.handleServerOperationReceived(operation);
+ if (pairResult.client) {
+ if (pairResult.client->getPos() != -1) {
+ onOperationReceived(pairResult.client);
+ }
+ lastOpID = pairResult.client->getID();
+ }
- if (pairResult.server) {
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
- payload->setOperation(pairResult.server);
- sendPayload(payload);
- }
- }
+ if (pairResult.server) {
+ WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ payload->setOperation(pairResult.server);
+ sendPayload(payload);
+ }
+ }
- void IncomingWhiteboardSession::sendOperation(WhiteboardOperation::ref operation) {
- operation->setID(idGenerator.generateID());
- operation->setParentID(lastOpID);
- lastOpID = operation->getID();
+ void IncomingWhiteboardSession::sendOperation(WhiteboardOperation::ref operation) {
+ operation->setID(idGenerator.generateID());
+ operation->setParentID(lastOpID);
+ lastOpID = operation->getID();
- WhiteboardOperation::ref result = client.handleLocalOperationReceived(operation);
+ WhiteboardOperation::ref result = client.handleLocalOperationReceived(operation);
- if (result) {
- WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
- payload->setOperation(result);
- sendPayload(payload);
- }
- }
+ if (result) {
+ WhiteboardPayload::ref payload = boost::make_shared<WhiteboardPayload>();
+ payload->setOperation(result);
+ sendPayload(payload);
+ }
+ }
}