diff options
Diffstat (limited to 'Swiften/Whiteboard/WhiteboardSession.cpp')
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp index 064ab3a..23ca312 100644 --- a/Swiften/Whiteboard/WhiteboardSession.cpp +++ b/Swiften/Whiteboard/WhiteboardSession.cpp @@ -21,54 +21,54 @@ #include <Swiften/Queries/IQRouter.h> namespace Swift { - WhiteboardSession::WhiteboardSession(const JID& jid, IQRouter* router) : toJID_(jid), router_(router) { - } + WhiteboardSession::WhiteboardSession(const JID& jid, IQRouter* router) : toJID_(jid), router_(router) { + } - WhiteboardSession::~WhiteboardSession() { - } + WhiteboardSession::~WhiteboardSession() { + } - void WhiteboardSession::handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload) { - switch (payload->getType()) { - case WhiteboardPayload::Data: - handleIncomingOperation(payload->getOperation()); - return; - case WhiteboardPayload::SessionAccept: - onRequestAccepted(toJID_); - return; - case WhiteboardPayload::SessionTerminate: - onSessionTerminated(toJID_); - return; + void WhiteboardSession::handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload) { + switch (payload->getType()) { + case WhiteboardPayload::Data: + handleIncomingOperation(payload->getOperation()); + return; + case WhiteboardPayload::SessionAccept: + onRequestAccepted(toJID_); + return; + case WhiteboardPayload::SessionTerminate: + onSessionTerminated(toJID_); + return; - //handled elsewhere - case WhiteboardPayload::SessionRequest: + //handled elsewhere + case WhiteboardPayload::SessionRequest: - case WhiteboardPayload::UnknownType: - return; - } - } + case WhiteboardPayload::UnknownType: + return; + } + } - void WhiteboardSession::sendElement(const WhiteboardElement::ref element) { - boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(); - payload->setElement(element); - boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); - request->send(); - } + void WhiteboardSession::sendElement(const WhiteboardElement::ref element) { + boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(); + payload->setElement(element); + boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); + request->send(); + } - 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(); - } + 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(); + } - void WhiteboardSession::cancel() { - if (router_->isAvailable()) { - boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate); - boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); - request->send(); - } - onSessionTerminated(toJID_); - } + void WhiteboardSession::cancel() { + if (router_->isAvailable()) { + boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(WhiteboardPayload::SessionTerminate); + boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); + request->send(); + } + onSessionTerminated(toJID_); + } - const JID& WhiteboardSession::getTo() const { - return toJID_; - } + const JID& WhiteboardSession::getTo() const { + return toJID_; + } } |