Code

added sendProtocol
authordaleharvey <daleharvey@users.sourceforge.net>
Tue, 25 Jul 2006 23:51:32 +0000 (23:51 +0000)
committerdaleharvey <daleharvey@users.sourceforge.net>
Tue, 25 Jul 2006 23:51:32 +0000 (23:51 +0000)
src/jabber_whiteboard/session-manager.cpp
src/jabber_whiteboard/session-manager.h

index 536bc8db47020bd3eaae0288777808eba8be9f4d..36bf3615b77a5e54aa6345b16dcd01df5877955e 100644 (file)
@@ -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=
+    "<message type='chat' from='%s' to='%s' id='ink_%d'>"
+    "<wb 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,
+                           (MessageType)type,
+                           getSequenceNumber(),
+                           xmlData.c_str()
+                           ))
+        {
+        return false;
+        }
+        
+    return true;
+}
+
 bool
 SessionManager::sendGroup(const Glib::ustring &groupJid,
                                                  const MessageType type,
index 880049db883cdd5219e2b02bcb9cb865373c4717..0a2c22f558613fb38a87c69f21333f6815960c14 100644 (file)
@@ -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);
 
     /**
      *