[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/soc-kopete-jingle/kopete/protocols/jabber
From:       Detlev Casanova <detlev.casanova () gmail ! com>
Date:       2008-06-23 15:12:00
Message-ID: 1214233920.641781.27572.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 823486 by casanova:

 * @iris : Jingle tasks created (only the first session initiation stanza is \
                implemented)
 * @iris : Jingle session class created. JingleSession get all needed informations \
                and then create a Jingle Task to start the Jingle Session
 * Added Jingle actions (one for Video, one for Audio) and create and start a Jingle \
session when clicked.


 M  +17 -5     jabberchatsession.cpp  
 M  +3 -0      jabberchatsession.h  
 M  +43 -9     jabbercontact.cpp  
 M  +2 -1      jabbercontact.h  
 M  +8 -12     jingle/CMakeLists.txt  
 M  +25 -1     libiris/CMakeLists.txt  
 A             libiris/iris/jabber/jinglesession.cpp   [License: UNKNOWN]
 A             libiris/iris/jabber/jinglesession.h   [License: UNKNOWN]
 A             libiris/iris/jabber/jingletasks.cpp   [License: UNKNOWN]
 A             libiris/iris/jabber/jingletasks.h   [License: UNKNOWN]


--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jabberchatsession.cpp \
#823485:823486 @@ -437,12 +437,24 @@
 
 }
 
- void JabberChatSession::slotSendFile()
-      {
-              QList<Kopete::Contact*>contacts = members();
-              static_cast<JabberContact *>(contacts.first())->sendFile();
-      }
+void JabberChatSession::slotSendFile()
+{
+	QList<Kopete::Contact*>contacts = members();
+	static_cast<JabberContact *>(contacts.first())->sendFile();
+}
 
+void JabberChatSession::slotJingleAudioCall()
+{
+	QList<Kopete::Contact*>contacts = members();
+	static_cast<JabberContact *>(contacts.first())->startJingleAudioCall();
+}
+
+void JabberChatSession::slotJingleVideoCall()
+{
+	QList<Kopete::Contact*>contacts = members();
+	static_cast<JabberContact *>(contacts.first())->startJingleVideoCall();
+}
+
 #include "jabberchatsession.moc"
 
 // vim: set noet ts=4 sts=4 sw=4:
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jabberchatsession.h \
#823485:823486 @@ -86,6 +86,9 @@
 
 	void slotSendFile();
 
+	void slotJingleAudioCall();
+	void slotJingleVideoCall();
+
 private:
 	enum  Event { Delivered, Displayed,
 		Composing, CancelComposing, Inactive, Gone } ;
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jabbercontact.cpp \
#823485:823486 @@ -66,6 +66,8 @@
 	#include "jinglevoicesession.h"
 	#include "jinglevoicesessiondialog.h"
 #endif
+#include "jinglesession.h"
+#include "jingletasks.h"
 
 /**
  * JabberContact constructor
@@ -249,21 +251,25 @@
 	
 	
 //#ifdef SUPPORT_JINGLE
+#if 0
+	KAction *testAction = new KAction(i18n("Test action"), this);
+	actionJingleAudioCall->setEnabled( true );
+	actionCollection->append( testAction );
+
 	KAction *actionJingleAudioCall = new KAction(i18n("Jingle Audio call"), this);
-	connect(actionJingleAudioCall, \
                SIGNAL(triggered(bool)),SLOT(slotJingleAudioCall()));
-	actionJingleAudioCall->setEnabled( false );
+	connect(actionJingleAudioCall, SIGNAL(triggered(bool)), \
SLOT(slotJingleAudioCall()));  
 	KAction *actionJingleVideoCall = new KAction(i18n("Jingle Video call"), this);
-	connect(actionJingleVideoCall, \
                SIGNAL(triggered(bool)),SLOT(slotJingleVideoCall()));
-	actionJingleVideoCall->setEnabled( false );
+	connect(actionJingleVideoCall, SIGNAL(triggered(bool)), \
SLOT(slotJingleVideoCall()));  
-	actionCollection->append( actionJingleAudioCall );
-	actionCollection->append( actionJingleVideoCall );
-
 	// Check if the current contact support jingle calls, also honor lock by default.
 	JabberResource *bestResource = account()->resourcePool()->bestJabberResource( \
mRosterItem.jid() );  actionJingleAudioCall->setEnabled( \
bestResource->features().canJingleAudio() );  actionJingleVideoCall->setEnabled( \
bestResource->features().canJingleVideo() ); +	
+	actionCollection->append( actionJingleAudioCall );
+	actionCollection->append( actionJingleVideoCall );
+#endif
 //#endif
 	
 	return actionCollection;
@@ -1295,7 +1301,7 @@
 				is_transport=true;
 				tr_type=ident.type;
 				//name=ident.name;
-				
+		
 				break;  //(we currently only support gateway)
 			}
 			else if (ident.category == "service")
@@ -1344,8 +1350,36 @@
 }
 
 
-void JabberContact::slotJingleVideoCall()
+void JabberContact::startJingleAudioCall()
 {
+	startJingleVideoCall();
+	//TODO: implement me.
+	//jingleSessionManager->newSession(to);
+	
+	//--Test purpose--
+	XMPP::JingleSession *session = new \
XMPP::JingleSession(account()->client()->rootTask(), XMPP::Jid(fullAddress())); +	
+	QDomDocument doc;
+	QDomElement payload = doc.createElement("payload-type");
+	payload.setAttribute("id", "96");
+	payload.setAttribute("name", "speex");
+	payload.setAttribute("clockrate", "16000");
+	
+	XMPP::JingleContent content;
+	content.addPayloadType(payload);
+	content.setDesriptionNS("urn:xmpp:tmp:jingle:apps:audio-rtp");
+	content.setProfile("RTP/AVP");
+	content.setName("ContentTest");
+	content.setCreator("initiator");
+	content.addTransportNS("urn:xmpp:tmp:jingle:transports:ice-udp");
+	
+	session->addContent(content);
+
+	session->start();
+}
+
+void JabberContact::startJingleVideoCall()
+{
 	kDebug() << "Start a Jingle Session";
 
 	XMPP::Jid jid = rosterItem().jid();
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jabbercontact.h \
#823485:823486 @@ -116,7 +116,8 @@
 	  * This is the JabberContact level slot for starting a Jingle Video call.
 	  * See later for params...
 	  */
-	 void slotJingleVideoCall();
+	 void startJingleAudioCall();
+	 void startJingleVideoCall();
 
 private slots:
 
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/CMakeLists.txt \
#823485:823486 @@ -5,20 +5,16 @@
 #add_subdirectory( libiris ) 
 
 #message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(JINGLE)")
+
 include_directories( 
-${KOPETE_INCLUDES} 
-${CMAKE_CURRENT_SOURCE_DIR}/../ui/ 
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/include/
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/jabber/ 
-${CMAKE_CURRENT_SOURCE_DIR}/libiris/iris/xmpp-core/ 
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/xmpp-im/ 
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/cutestuff/util/ 
-${CMAKE_CURRENT_SOURCE_DIR}/libiris/cutestuff/network/ 
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/cutestuff/ 
-${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/ 
+${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/src/xmpp/cutestuff/ 
+${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/include/iris/ 
+${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/src/xmpp/xmpp-core/ 
+${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/src/xmpp/xmpp-im/ 
+${CMAKE_CURRENT_SOURCE_DIR}/../libiris/iris/src/xmpp/
 ${QCA2_INCLUDE_DIR} 
-${CMAKE_CURRENT_SOURCE_DIR}/../ 
-#Some unneeded ?
+${IDN_INCLUDE_DIR}
+${ZLIB_INCLUDE_DIR}
 )
 
 #link_directories( ${CMAKE_CURRENT_BINARY_DIR}/../libiris/iris/xmpp-im ./)
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/CMakeLists.txt \
#823485:823486 @@ -35,7 +35,8 @@
 iris/jabber/filetransfer.cpp
 iris/jabber/s5b.cpp
 iris/jabber/xmpp_ibb.cpp
-iris/jabber/jingle.cpp
+iris/jabber/jinglesession.cpp
+iris/jabber/jingletasks.cpp
 
 iris/xmpp-core/compress.cpp
 iris/xmpp-core/compressionhandler.cpp
@@ -97,12 +98,29 @@
 
 #	iris/xmpp-im/xmpp_tasks.h
 #	iris/xmpp-im/xmpp_discoinfotask.h
+	iris/jabber/jinglesession.h
+	iris/jabber/jingletasks.h
 )
 
+#set(testapp_SRCS
+#xmpptest/xmpptest.cpp
+#)
+
+#qt4_wrap_ui(testapp_SRCS
+#xmpptest/ui_test.ui
+#)
+
+#kde4_moc_headers(testapp
+#xmpptest/xmpptest.cpp
+#)
+
 kde4_add_library(iris_kopete SHARED ${libiris_SRCS})
 
+#kde4_add_executable(testapp ${testapp_SRCS})
+
 set(iris_kopete_libs ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} \
${QT_QT3SUPPORT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY}  ${IDN_LIBRARY} \
${QCA2_LIBRARIES} ${ZLIB_LIBRARIES}) +
 if(WIN32)
   set(iris_kopete_libs ${iris_kopete_libs} ws2_32)
 endif(WIN32)
@@ -114,6 +132,12 @@
 endif(HAVE_NSL_LIBRARY)
 target_link_libraries(iris_kopete ${iris_kopete_libs})
 
+#set(iris_testapp_libs ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} \
${QT_QT3SUPPORT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} +#               \
${IDN_LIBRARY} ${QCA2_LIBRARIES} ${ZLIB_LIBRARIES} +#		     iris_kopete)
+
+#target_link_libraries(testapp ${iris_testapp_libs})
+
 set_target_properties(iris_kopete PROPERTIES VERSION 1.0.0 SOVERSION 1 )
 install(TARGETS iris_kopete ${INSTALL_TARGETS_DEFAULT_ARGS})
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic