From 1ffa61a4b3956d4af5770250a53b03991ac785fd Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Sun, 1 Apr 2012 15:30:39 +0100 Subject: tubes: make conference hold a TpDBusTubeChannel It already was, actually. :) --- tubes/inc/tubes/conference.hxx | 8 ++++---- tubes/source/conference.cxx | 22 ++++++++++++---------- tubes/source/manager.cxx | 6 +++--- 3 files changed, 19 insertions(+), 17 deletions(-) (limited to 'tubes') diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index 118def66621d..fca6e2ed5278 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -49,7 +49,7 @@ class TeleConference : public boost::enable_shared_from_this { public: - TeleConference( TeleManager* pManager, TpAccount *pAccount, TpChannel* pChannel, const rtl::OString& rSessionId ); + TeleConference( TeleManager* pManager, TpAccount *pAccount, TpDBusTubeChannel* pChannel, const rtl::OString& rSessionId ); ~TeleConference(); /// Close channel and call finalize() @@ -79,8 +79,8 @@ public: // --- following only to be called only by manager's callbacks --- // TODO: make friends instead - void setChannel( TpAccount* pAccount, TpChannel* pChannel ); - TpChannel* getChannel() const { return mpChannel; } + void setChannel( TpAccount* pAccount, TpDBusTubeChannel* pChannel ); + TpDBusTubeChannel* getChannel() const { return mpChannel; } bool offerTube(); bool acceptTube(); /// got tube accepted on other end as well? @@ -117,7 +117,7 @@ private: rtl::OString maSessionId; TeleManager* mpManager; TpAccount* mpAccount; - TpChannel* mpChannel; + TpDBusTubeChannel* mpChannel; gchar* mpAddress; GDBusConnection* mpTube; guint maObjectRegistrationId; diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx index 9c2e8d761efe..1cd9248b466f 100644 --- a/tubes/source/conference.cxx +++ b/tubes/source/conference.cxx @@ -142,7 +142,7 @@ static void TeleConference_ChannelCloseHandler( void TeleConference::TubeOfferedHandler( - TpChannel* pChannel, + TpChannel* pBaseChannel, const gchar* pAddress, const GError* pError, gpointer pUserData, @@ -168,8 +168,9 @@ void TeleConference::TubeOfferedHandler( if (!pAddress) return; + TpDBusTubeChannel* pChannel = TP_DBUS_TUBE_CHANNEL( pBaseChannel); SAL_WARN_IF( pChannel != pConference->getChannel(), "tubes", "TeleConference::TubeOfferedHandler: not my channel"); - if (pChannel != pConference->getChannel()) + if ((pChannel) != pConference->getChannel()) return; pConference->mpAddress = g_strdup( pAddress ); @@ -192,7 +193,7 @@ bool TeleConference::tryToOpen() } void TeleConference::TubeChannelStateChangedHandler( - TpChannel* pChannel, + TpChannel* pBaseChannel, guint nState, gpointer pUserData, GObject* /*weak_object*/ @@ -207,6 +208,7 @@ void TeleConference::TubeChannelStateChangedHandler( if (!pConference) return; + TpDBusTubeChannel* pChannel = TP_DBUS_TUBE_CHANNEL( pBaseChannel); SAL_WARN_IF( pChannel != pConference->getChannel(), "tubes", "TeleConference::TubeChannelStateChangedHandler: not my channel"); if (pChannel != pConference->getChannel()) @@ -217,7 +219,7 @@ void TeleConference::TubeChannelStateChangedHandler( } -TeleConference::TeleConference( TeleManager* pManager, TpAccount* pAccount, TpChannel* pChannel, const rtl::OString& rSessionId ) +TeleConference::TeleConference( TeleManager* pManager, TpAccount* pAccount, TpDBusTubeChannel* pChannel, const rtl::OString& rSessionId ) : maSessionId( rSessionId ), mpManager( pManager), @@ -238,7 +240,7 @@ TeleConference::~TeleConference() } -void TeleConference::setChannel( TpAccount *pAccount, TpChannel* pChannel ) +void TeleConference::setChannel( TpAccount *pAccount, TpDBusTubeChannel* pChannel ) { OSL_ENSURE( !mpChannel, "TeleConference::setChannel: already have channel"); if (mpChannel) @@ -254,7 +256,7 @@ void TeleConference::setChannel( TpAccount *pAccount, TpChannel* pChannel ) GError* pError = NULL; TpProxySignalConnection* pProxySignalConnection = tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed( - mpChannel, + TP_CHANNEL( mpChannel), &TeleConference::TubeChannelStateChangedHandler, this, NULL, @@ -295,7 +297,7 @@ bool TeleConference::acceptTube() if (!mpChannel || mpTube) return false; - tp_cli_channel_type_dbus_tube_call_accept( mpChannel, -1, + tp_cli_channel_type_dbus_tube_call_accept( TP_CHANNEL( mpChannel), -1, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS, &TeleConference::TubeOfferedHandler, this, NULL, NULL); @@ -318,7 +320,7 @@ bool TeleConference::offerTube() NULL); tp_cli_channel_type_dbus_tube_call_offer( - mpChannel, // proxy + TP_CHANNEL( mpChannel), // proxy -1, // timeout_ms pParams, // in_parameters TP_SOCKET_ACCESS_CONTROL_CREDENTIALS, // in_access_control @@ -387,7 +389,7 @@ void TeleConference::close() INFO_LOGGER( "TeleConference::close"); if (mpChannel) - tp_cli_channel_call_close( mpChannel, 5000, TeleConference_ChannelCloseHandler, this, NULL, NULL); + tp_cli_channel_call_close( TP_CHANNEL( mpChannel), 5000, TeleConference_ChannelCloseHandler, this, NULL, NULL); else finalize(); } @@ -552,7 +554,7 @@ void TeleConference::sendFile( rtl::OUString &localUri, FileSentCallback pCallba SendFileRequest *pReq = new SendFileRequest( this, pCallback, pUserData); empathy_ft_handler_new_outgoing( mpAccount, - tp_channel_get_target_contact( mpChannel), + tp_channel_get_target_contact( TP_CHANNEL( mpChannel)), pSource, 0, &TeleConference::FTReady, pReq); diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx index 32589f10a9ae..2e0cd3e3023d 100644 --- a/tubes/source/manager.cxx +++ b/tubes/source/manager.cxx @@ -119,12 +119,12 @@ void TeleManager::DBusChannelHandler( SAL_INFO( "tubes", "TeleManager::DBusChannelHandler: incoming dbus channel: " << tp_channel_get_identifier( pChannel)); - if (tp_channel_get_channel_type_id( pChannel) == TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE) + if (TP_IS_DBUS_TUBE_CHANNEL( pChannel)) { SAL_INFO( "tubes", "accepting"); aAccepted = true; - TeleConferencePtr pConference( new TeleConference( pManager, pAccount, pChannel, "")); + TeleConferencePtr pConference( new TeleConference( pManager, pAccount, TP_DBUS_TUBE_CHANNEL( pChannel), "")); pManager->maConferences.push_back( pConference); pConference->acceptTube(); } @@ -283,7 +283,7 @@ static void TeleManager_ChannelReadyHandler( } pConference->setChannel( tp_account_channel_request_get_account( pChannelRequest), - pChannel); + TP_DBUS_TUBE_CHANNEL (pChannel)); pConference->offerTube(); } -- cgit v1.2.3