From df2369657ebe36c3888bb032e693bf1fcb49bb51 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Thu, 26 Jul 2012 17:56:12 +0200 Subject: tubes: send file when inviting contact to MUC collaboration - add UUID info to TeleConference - let SendFile function take argument for contact instead of getting contact from the channel info, what couldn't work for MUC channel Change-Id: I4dc45c084966a030ff4b503e192d452797f0bfdd --- tubes/inc/tubes/conference.hxx | 2 +- tubes/qa/test_manager.cxx | 2 +- tubes/source/conference.cxx | 4 ++-- tubes/source/manager.cxx | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tubes') diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index fc495e5247d9..e5c5d370098b 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -66,7 +66,7 @@ public: boost::signals2::signal sigPacketReceived; typedef void (*FileSentCallback)( bool aSuccess, void* pUserData); - TUBES_DLLPUBLIC void sendFile( rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData); + TUBES_DLLPUBLIC void sendFile( TpContact* pContact, rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData); TUBES_DLLPUBLIC const OString& getUuid() const { return msUuid; } // --- following only to be called only by manager's callbacks --- diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx index f914b3331033..ca03bae0ed08 100644 --- a/tubes/qa/test_manager.cxx +++ b/tubes/qa/test_manager.cxx @@ -264,7 +264,7 @@ void TestTeleTubes::testSendFile() /* This has to run after testContactList has run successfully. */ CPPUNIT_ASSERT( mpAccepterContact != 0); - mpConference1->sendFile( maTestConfigIniURL, + mpConference1->sendFile( mpAccepterContact, maTestConfigIniURL, &TestTeleTubes::FileSent, NULL); /* Waiting for event: FileSent quits the mainloop */ g_main_loop_run( mpMainLoop); diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx index d28ffc34aabf..bc2dc753f91f 100644 --- a/tubes/source/conference.cxx +++ b/tubes/source/conference.cxx @@ -510,7 +510,7 @@ static void TeleConference_FTReady( EmpathyFTHandler *handler, GError *error, gp } -void TeleConference::sendFile( rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData) +void TeleConference::sendFile( TpContact* pContact, rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData) { INFO_LOGGER( "TeleConference::sendFile"); @@ -524,7 +524,7 @@ void TeleConference::sendFile( rtl::OUString &localUri, FileSentCallback pCallba SendFileRequest *pReq = new SendFileRequest( pCallback, pUserData); empathy_ft_handler_new_outgoing( mpAccount, - tp_channel_get_target_contact( TP_CHANNEL( mpChannel)), + pContact, pSource, 0, TeleConference_FTReady, pReq); diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index 9df5468e80b8..c0f742719321 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -221,6 +221,7 @@ void TeleManager_TransferDone( EmpathyFTHandler *handler, TpFileTransferChannel sal_Int32 first = aUri.indexOf('_'); sal_Int32 last = aUri.lastIndexOf('_'); + SAL_WARN_IF( first == last, "tubes", "No UUID to associate with the file!" ); if (first != last) { OString sUuid( OUStringToOString( aUri.copy( first + 1, last - first - 1), @@ -600,7 +601,7 @@ TeleConference* TeleManager::startGroupSession( TpAccount *pAccount, setChannelReadyHandlerInvoked( false); - TeleConference* pConference = new TeleConference( this, NULL, NULL ); + TeleConference* pConference = new TeleConference( this, NULL, NULL, aSessionId ); tp_account_channel_request_create_and_handle_channel_async( pChannelRequest, NULL, TeleManager_ChannelReadyHandler, pConference); -- cgit