summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5aa2656)
raw | patch | inline | side by side (parent: 5aa2656)
author | daleharvey <daleharvey@users.sourceforge.net> | |
Sun, 30 Jul 2006 17:19:19 +0000 (17:19 +0000) | ||
committer | daleharvey <daleharvey@users.sourceforge.net> | |
Sun, 30 Jul 2006 17:19:19 +0000 (17:19 +0000) |
index d97520d55892fe7999698915a7a7cf387a03d4e5..3e3895ea04207e71e77e02e48e039ef0eadba4e2 100644 (file)
namespace Message {
- Wrapper PROTOCOL = 0;
- Wrapper NEW = 1;
- Wrapper REMOVE = 2;
- Wrapper CONFIGURE = 3;
- Wrapper MOVE = 4;
-
- Message CONNECT_REQUEST = "connect-request";
- Message CONNECTED = "connected";
- Message ACCEPT_INVITATION = "accept-invitation";
- Message DECLINE_INVITATION = "decline-invitation";
- Message DOCUMENT_BEGIN = "document-begin";
- Message DOCUMENT_END = "document-end";
+ Wrapper PROTOCOL = "protocol";
+ Wrapper NEW = "new";
+ Wrapper REMOVE = "remove";
+ Wrapper CONFIGURE = "configure";
+ Wrapper MOVE = "move";
+
+ Message CONNECT_REQUEST = "<connect-request />";
+ Message CONNECTED = "<connected />";
+ Message ACCEPT_INVITATION = "<accept-invitation />";
+ Message DECLINE_INVITATION = "<decline-invitation />";
+ Message DOCUMENT_BEGIN = "<document-begin />";
+ Message DOCUMENT_END = "<document-end />";
}
namespace Vars {
index 05e4b9b7651056bd585f853bd6957adcffae690a..a5d2d2ce6a7ec867c66c1d9bc7f577740b083485 100644 (file)
namespace Message {
- typedef int const Wrapper;
+ typedef char const* Wrapper;
typedef char const* Message;
extern Wrapper PROTOCOL;
diff --git a/src/jabber_whiteboard/inkboard-document.cpp b/src/jabber_whiteboard/inkboard-document.cpp
index e53b7ec800b71b72856814535d087defd455c4cf..e6bd4371396d6e7360a8781d906ade4ea60a0c9c 100644 (file)
void
InkboardDocument::startSessionNegotiation()
{
- send(_recipient, Message::PROTOCOL,Message::CONNECT_REQUEST);
+ sendProtocol(_recipient, Message::PROTOCOL,Message::CONNECT_REQUEST);
}
void
@@ -68,19 +68,20 @@ InkboardDocument::processInkboardEvent(Message::Wrapper mtype, unsigned int seqn
}
bool
-InkboardDocument::send(const Glib::ustring &destJid, Message::Wrapper wrapper, Message::Message message)
+InkboardDocument::sendProtocol(const Glib::ustring &destJid, Message::Wrapper wrapper,
+ Message::Message message)
{
char *fmt=
"<message type='%s' from='%s' to='%s'>"
"<wb xmlns='%s'>"
- "<protocol>"
+ "<%s>"
"%s"
- "</protocol>"
+ "</%s>"
"</wb>"
"</message>";
if (!sm->getClient().write(
fmt,_type,sm->getClient().getJid().c_str(),
- destJid.c_str(),Vars::INKBOARD_XMLNS,message))
+ destJid.c_str(),wrapper,Vars::INKBOARD_XMLNS,message,wrapper))
return false;
return true;
index 1249c42f89f74ceb3e98aff05faffd93c69042d8..6e04fddac9ac8fe44b9a733b8069c5bc80e8dcfb 100644 (file)
return Inkscape::XML::DOCUMENT_NODE;
}
- SessionManager *sm;
-
void setRecipient(Glib::ustring const& val);
Glib::ustring getRecipient() const;
- void setSession();
-
void startSessionNegotiation();
void terminateSession();
void processInkboardEvent(Message::Wrapper mtype, unsigned int seqnum, Glib::ustring const& data);
- bool send(const Glib::ustring &destJid, Message::Wrapper mwrapper, Message::Message message);
- bool send(const Glib::ustring &destJid, Message::Wrapper mwrapper, const Glib::ustring &data);
+ bool sendProtocol(const Glib::ustring &destJid, Message::Wrapper mwrapper,
+ Message::Message message);
protected:
void _initBindings();
+ SessionManager *sm;
State::SessionType _type;
Glib::ustring _recipient;
index daab6bcbe72c20146be99fdc1597d4c378de829f..e669403cf1bf015dbf70fcec8bd37af87660f0ae 100644 (file)
getClient().getMsgId(),
INKBOARD_XMLNS,
2,
- (MessageType)type,
+ type,
getSequenceNumber(),
xmlData.c_str()
))