Code

restructuring session-manager
authordaleharvey <daleharvey@users.sourceforge.net>
Sun, 30 Jul 2006 19:24:17 +0000 (19:24 +0000)
committerdaleharvey <daleharvey@users.sourceforge.net>
Sun, 30 Jul 2006 19:24:17 +0000 (19:24 +0000)
src/jabber_whiteboard/invitation-handlers.cpp
src/jabber_whiteboard/pedrogui.cpp
src/jabber_whiteboard/session-manager.cpp
src/jabber_whiteboard/session-manager.h

index f304d095e04d9d976e9efb1e1c3855e799ad3a48..1ddf479e09d07e586ab4241a6fcc633e85e4e433 100644 (file)
@@ -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;
                }
 
index 3b689b395ef393b1bafbf2c62b045a4025138a0b..fc58dc349b19ecaa57d2144109c0f10f3085a3b8 100644 (file)
@@ -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);
 }
 
 //##################
index e669403cf1bf015dbf70fcec8bd37af87660f0ae..a64efbdb33efe821fd8be87c0695cadbd849b310 100644 (file)
@@ -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=
-    "<message type='chat' from='%s' to='%s' id='ink_%d'>"
-    "<w xmlns='%s' "
-    "protocol='%d' type='%d' seq='%d'><x:inkboard-data>%s</x:inkboard-data></inkboard>"
-    "<body></body>"
-    "</message>";
-    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=
-    "<message type='groupchat' from='%s' to='%s' id='ink_%d'>"
-    "<inkboard xmlns='%s' "
-    "protocol='%d' type='%d' seq='%d'><x:inkboard-data>%s</x:inkboard-data></inkboard>"
-    "<body></body>"
-    "</message>";
-    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:
             {
index d6e600fe448c108301ca9e113e58d179a39ccb1f..7e61c6b91957ad0bcd0afce006a72688815213e6 100644 (file)
@@ -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);
     /**
      *
      */