From: daleharvey Date: Sun, 30 Jul 2006 19:24:17 +0000 (+0000) Subject: restructuring session-manager X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fa1b6dbd11c790efd8f2a3cb37c7fea3be4e446b;p=inkscape.git restructuring session-manager --- diff --git a/src/jabber_whiteboard/invitation-handlers.cpp b/src/jabber_whiteboard/invitation-handlers.cpp index f304d095e..1ddf479e0 100644 --- a/src/jabber_whiteboard/invitation-handlers.cpp +++ b/src/jabber_whiteboard/invitation-handlers.cpp @@ -58,7 +58,7 @@ SessionManager::_checkInvitationQueue() { SPDesktop* dt = createInkboardDesktop(from, State::WHITEBOARD_PEER); InkboardDocument* idoc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc); - send(from, Message::PROTOCOL, " "); + //sendProtocol(from, Message::PROTOCOL, " "); break; } case DECLINE_INVITATION: @@ -66,7 +66,7 @@ SessionManager::_checkInvitationQueue() break; } default: - send(from, Message::PROTOCOL, " "); + //sendProtocol(from, Message::PROTOCOL, " "); break; } diff --git a/src/jabber_whiteboard/pedrogui.cpp b/src/jabber_whiteboard/pedrogui.cpp index 3b689b395..fc58dc349 100644 --- a/src/jabber_whiteboard/pedrogui.cpp +++ b/src/jabber_whiteboard/pedrogui.cpp @@ -2473,8 +2473,6 @@ void PedroGui::doShare(const DOMString &jid) Inkscape::Whiteboard::SessionManager& sm = Inkscape::Whiteboard::SessionManager::instance(); sm.doShare(jid, Inkscape::Whiteboard::State::WHITEBOARD_PEER); - -// Inkscape::Whiteboard::SessionManager::instance().createInkboardDesktop(jid, Inkscape::Whiteboard::INKBOARD_PRIVATE); } void PedroGui::doGroupShare(const DOMString &groupJid) @@ -2482,8 +2480,6 @@ void PedroGui::doGroupShare(const DOMString &groupJid) Inkscape::Whiteboard::SessionManager& sm = Inkscape::Whiteboard::SessionManager::instance(); sm.doShare(groupJid, Inkscape::Whiteboard::State::WHITEBOARD_MUC); - -// Inkscape::Whiteboard::SessionManager::instance().createInkboardDesktop(groupJid, Inkscape::Whiteboard::INKBOARD_MUC); } //################## diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index e669403cf..a64efbdb3 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -73,74 +73,13 @@ SessionManager::~SessionManager() getClient().disconnect(); } -unsigned long SessionManager::getSequenceNumber() -{ - return sequenceNumber++; -} - -bool -SessionManager::send(const Glib::ustring &destJid, - const Message::Wrapper 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, - type, - getSequenceNumber(), - xmlData.c_str() - )) - { - return false; - } - - return true; -} - -bool -SessionManager::sendGroup(const Glib::ustring &groupJid, - const Message::Wrapper type, - const Glib::ustring &data) -{ - Pedro::DOMString xmlData = Pedro::Parser::encode(data); - char *fmt= - "" - "%s" - "" - ""; - if (!getClient().write(fmt, - getClient().getJid().c_str(), - groupJid.c_str(), - getClient().getMsgId(), - INKBOARD_XMLNS, - 2, - type, - getSequenceNumber(), - xmlData.c_str() - )) - { - return false; - } - - return true; -} - void SessionManager::processXmppEvent(const Pedro::XmppEvent &event) { int type = event.getType(); + g_warning("recieved pedro"); + switch (type) { case Pedro::XmppEvent::EVENT_STATUS: { diff --git a/src/jabber_whiteboard/session-manager.h b/src/jabber_whiteboard/session-manager.h index d6e600fe4..7e61c6b91 100644 --- a/src/jabber_whiteboard/session-manager.h +++ b/src/jabber_whiteboard/session-manager.h @@ -56,30 +56,12 @@ public: static void showClient(); static SessionManager& instance(); - /** - * - */ - unsigned long getSequenceNumber(); - /** * */ virtual Pedro::XmppClient &getClient() { return gui.client; } - /** - * - */ - virtual bool send(const Glib::ustring &destJid, - const Message::Wrapper type, - const Glib::ustring &data); - - /** - * - */ - virtual bool sendGroup(const Glib::ustring &destJid, - const Message::Wrapper type, - const Glib::ustring &data); /** * */