diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-29 07:32:51 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-29 07:33:48 (GMT) |
commit | a8f57139d663a176af87d7bc71dd85c62f6274cf (patch) | |
tree | e1c4def39b63d64e6f4ad7baefceae0f154789ce /Swiften/Whiteboard | |
parent | dc04410eb678b8db257dc04b04662f974f6b3b83 (diff) | |
download | swift-contrib-a8f57139d663a176af87d7bc71dd85c62f6274cf.zip swift-contrib-a8f57139d663a176af87d7bc71dd85c62f6274cf.tar.bz2 |
Improved handling of IDs
Added ID parsing to every element and added function to get prefixes from
session to be able to distinguish elements between clients
Diffstat (limited to 'Swiften/Whiteboard')
-rw-r--r-- | Swiften/Whiteboard/IncomingWhiteboardSession.cpp | 4 | ||||
-rw-r--r-- | Swiften/Whiteboard/IncomingWhiteboardSession.h | 1 | ||||
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.cpp | 4 | ||||
-rw-r--r-- | Swiften/Whiteboard/OutgoingWhiteboardSession.h | 1 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.cpp | 7 | ||||
-rw-r--r-- | Swiften/Whiteboard/WhiteboardSession.h | 2 |
6 files changed, 11 insertions, 8 deletions
diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp index 92a86a1..5cdba1a 100644 --- a/Swiften/Whiteboard/IncomingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/IncomingWhiteboardSession.cpp @@ -19,4 +19,8 @@ namespace Swift { boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); request->send(); } + + std::string IncomingWhiteboardSession::getClientID() const { + return "b"; + } } diff --git a/Swiften/Whiteboard/IncomingWhiteboardSession.h b/Swiften/Whiteboard/IncomingWhiteboardSession.h index a0d0b49..9971d75 100644 --- a/Swiften/Whiteboard/IncomingWhiteboardSession.h +++ b/Swiften/Whiteboard/IncomingWhiteboardSession.h @@ -20,5 +20,6 @@ namespace Swift { ~IncomingWhiteboardSession(); void accept(); + std::string getClientID() const; }; } diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp index 2693fcd..585a689 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.cpp @@ -21,4 +21,8 @@ namespace Swift { boost::shared_ptr<GenericRequest<WhiteboardPayload> > request = boost::make_shared<GenericRequest<WhiteboardPayload> >(IQ::Set, toJID_, payload, router_); request->send(); } + + std::string OutgoingWhiteboardSession::getClientID() const { + return "a"; + } } diff --git a/Swiften/Whiteboard/OutgoingWhiteboardSession.h b/Swiften/Whiteboard/OutgoingWhiteboardSession.h index dfbd200..3d0dd1a 100644 --- a/Swiften/Whiteboard/OutgoingWhiteboardSession.h +++ b/Swiften/Whiteboard/OutgoingWhiteboardSession.h @@ -20,5 +20,6 @@ namespace Swift { OutgoingWhiteboardSession(const JID& jid, IQRouter* router); virtual ~OutgoingWhiteboardSession(); void startSession(); + std::string getClientID() const; }; } diff --git a/Swiften/Whiteboard/WhiteboardSession.cpp b/Swiften/Whiteboard/WhiteboardSession.cpp index 18dea52..d9dc592 100644 --- a/Swiften/Whiteboard/WhiteboardSession.cpp +++ b/Swiften/Whiteboard/WhiteboardSession.cpp @@ -35,13 +35,6 @@ namespace Swift { } } - void WhiteboardSession::sendData(const std::string& data) { - boost::shared_ptr<WhiteboardPayload> payload = boost::make_shared<WhiteboardPayload>(); - payload->setData(data); - 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); diff --git a/Swiften/Whiteboard/WhiteboardSession.h b/Swiften/Whiteboard/WhiteboardSession.h index e7deb85..d3e435a 100644 --- a/Swiften/Whiteboard/WhiteboardSession.h +++ b/Swiften/Whiteboard/WhiteboardSession.h @@ -26,10 +26,10 @@ namespace Swift { WhiteboardSession(const JID& jid, IQRouter* router); virtual ~WhiteboardSession(); void handleIncomingAction(boost::shared_ptr<WhiteboardPayload> payload); - void sendData(const std::string& data); void sendElement(const WhiteboardElement::ref element); void cancel(); const JID& getTo() const; + virtual std::string getClientID() const = 0; public: boost::signal< void(const WhiteboardElement::ref element)> onElementReceived; |