From c3c2dcf80de012b620de8563d7e872c3ae556881 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 7 Aug 2012 23:34:19 +0200 Subject: tubes: do not encode UUID into file name anymore Change-Id: I6c3828eb9c2f2d1810822e90006fc1af4bfcf277 --- tubes/inc/tubes/collaboration.hxx | 2 +- tubes/source/conference.cxx | 4 ++-- tubes/source/contacts.cxx | 9 +++------ tubes/source/manager.cxx | 25 +++++++++---------------- 4 files changed, 15 insertions(+), 25 deletions(-) (limited to 'tubes') diff --git a/tubes/inc/tubes/collaboration.hxx b/tubes/inc/tubes/collaboration.hxx index 8378ddae6823..18a64f0c2708 100644 --- a/tubes/inc/tubes/collaboration.hxx +++ b/tubes/inc/tubes/collaboration.hxx @@ -29,7 +29,7 @@ public: virtual void ContactLeft() const = 0; virtual void PacketReceived( const OString& rPacket ) const = 0; - virtual void SaveAndSendFile( TpContact* pContact, const OUString& rURL ) const = 0; + virtual void SaveAndSendFile( TpContact* pContact ) const = 0; virtual void StartCollaboration( TeleConference* pConference ) = 0; TUBES_DLLPRIVATE TeleConference* GetConference() const; diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx index 4bfd51c63b2e..8be9cab727e9 100644 --- a/tubes/source/conference.cxx +++ b/tubes/source/conference.cxx @@ -535,7 +535,7 @@ static void TeleConference_FTReady( EmpathyFTHandler *handler, GError *error, gp } // TODO: move sending file to TeleManager -extern void TeleManager_fileReceived( const OUString& ); +extern void TeleManager_fileReceived( const OUString&, const OString& ); void TeleConference::sendFile( TpContact* pContact, const OUString& localUri, FileSentCallback pCallback, void* pUserData) { INFO_LOGGER( "TeleConference::sendFile"); @@ -543,7 +543,7 @@ void TeleConference::sendFile( TpContact* pContact, const OUString& localUri, Fi if (!pContact) { // used in demo mode - TeleManager_fileReceived( localUri ); + TeleManager_fileReceived( localUri, "demo" ); return; } diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx index ef772dee58db..1472773f1ec2 100644 --- a/tubes/source/contacts.cxx +++ b/tubes/source/contacts.cxx @@ -88,8 +88,7 @@ class TubeContacts : public ModelessDialog { TpContact* pContact = pAC->second; mpCollaboration->GetConference()->invite( pContact ); - mpCollaboration->SaveAndSendFile( pContact, OStringToOUString( - mpCollaboration->GetConference()->getUuid(), RTL_TEXTENCODING_UTF8 ) ); + mpCollaboration->SaveAndSendFile( pContact ); } } } @@ -108,8 +107,7 @@ class TubeContacts : public ModelessDialog else { mpCollaboration->StartCollaboration( pConference ); - mpCollaboration->SaveAndSendFile( NULL, OStringToOUString( - pConference->getUuid(), RTL_TEXTENCODING_UTF8 ) ); + mpCollaboration->SaveAndSendFile( NULL ); } } @@ -130,8 +128,7 @@ class TubeContacts : public ModelessDialog else { mpCollaboration->StartCollaboration( pConference ); - mpCollaboration->SaveAndSendFile( pContact, OStringToOUString( - pConference->getUuid(), RTL_TEXTENCODING_UTF8 ) ); + mpCollaboration->SaveAndSendFile( pContact ); } } } diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index e1311c827749..340c0023579f 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -285,26 +285,19 @@ void TeleManager::setCurrentUuid( const OString& rUuid ) } // FIXME: should be static and not used in conference.cxx -void TeleManager_fileReceived( const rtl::OUString &rStr ) +void TeleManager_fileReceived( const OUString& rStr, const OString& rUuid ) { SAL_INFO( "tubes", "TeleManager_fileReceived: incoming file: " << rStr ); - sal_Int32 first = rStr.indexOf('_'); - sal_Int32 last = rStr.lastIndexOf('_'); - SAL_WARN_IF( first == last, "tubes", "No UUID to associate with the file!" ); - if (first != last) + OString sUuid( rUuid ); + if (sUuid == "demo") { - OString sUuid( OUStringToOString( rStr.copy( first + 1, last - first - 1), - RTL_TEXTENCODING_UTF8)); - if (sUuid == "demo") - { - sUuid = TeleManager::createUuid(); - TeleConference* pConference = new TeleConference( NULL, NULL, sUuid ); - TeleManager::addConference( pConference ); - TeleManager::registerDemoConference( pConference ); - } - TeleManager::setCurrentUuid( sUuid ); + sUuid = TeleManager::createUuid(); + TeleConference* pConference = new TeleConference( NULL, NULL, sUuid ); + TeleManager::addConference( pConference ); + TeleManager::registerDemoConference( pConference ); } + TeleManager::setCurrentUuid( sUuid ); css::uno::Reference< css::lang::XMultiServiceFactory > rFactory = ::comphelper::getProcessServiceFactory(); @@ -334,7 +327,7 @@ static void TeleManager_TransferDone( EmpathyFTHandler *handler, TpFileTransferC rtl::OUString aUri( OUString::createFromAscii( uri ) ); g_free( uri); - TeleManager_fileReceived( aUri ); + TeleManager_fileReceived( aUri, empathy_ft_handler_get_description( handler ) ); g_object_unref( handler); } -- cgit v1.2.3