From 239c921b1308b3a2ce8722c6f497b36b8425b68e Mon Sep 17 00:00:00 2001 From: daleharvey Date: Tue, 25 Jul 2006 23:51:32 +0000 Subject: [PATCH] added sendProtocol --- src/jabber_whiteboard/session-manager.cpp | 29 +++++++++++++++++++++++ src/jabber_whiteboard/session-manager.h | 6 +++++ 2 files changed, 35 insertions(+) diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index 536bc8db4..36bf3615b 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -106,6 +106,35 @@ SessionManager::send(const Glib::ustring &destJid, return true; } +bool +SessionManager::sendProtocol(const Glib::ustring &destJid, + const MessageType type, + const Glib::ustring &data) +{ + Pedro::DOMString xmlData = Pedro::Parser::encode(data); + char *fmt= + "" + "%s" + "" + ""; + if (!getClient().write(fmt, + getClient().getJid().c_str(), + destJid.c_str(), + getClient().getMsgId(), + INKBOARD_XMLNS, + 2, + (MessageType)type, + getSequenceNumber(), + xmlData.c_str() + )) + { + return false; + } + + return true; +} + bool SessionManager::sendGroup(const Glib::ustring &groupJid, const MessageType type, diff --git a/src/jabber_whiteboard/session-manager.h b/src/jabber_whiteboard/session-manager.h index 880049db8..0a2c22f55 100644 --- a/src/jabber_whiteboard/session-manager.h +++ b/src/jabber_whiteboard/session-manager.h @@ -75,6 +75,12 @@ public: virtual bool send(const Glib::ustring &destJid, const MessageType type, const Glib::ustring &data); + /** + * + */ + virtual bool sendProtocol(const Glib::ustring &destJid, + const MessageType type, + const Glib::ustring &data); /** * -- 2.30.2