From 011e348e114c1cc4ccdf6ce8e17024c81b9a0e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Tue, 7 Aug 2012 23:59:07 +0200 Subject: [PATCH] tubes: add invite to Collaboration class Change-Id: I37463d4365a2fe81e58d5f4bcf9f86d9830e26be --- tubes/inc/tubes/collaboration.hxx | 2 +- tubes/source/collaboration.cxx | 14 +++++++++----- tubes/source/contacts.cxx | 7 +------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tubes/inc/tubes/collaboration.hxx b/tubes/inc/tubes/collaboration.hxx index 18a64f0c2708..8aef9378bae6 100644 --- a/tubes/inc/tubes/collaboration.hxx +++ b/tubes/inc/tubes/collaboration.hxx @@ -32,8 +32,8 @@ public: virtual void SaveAndSendFile( TpContact* pContact ) const = 0; virtual void StartCollaboration( TeleConference* pConference ) = 0; - TUBES_DLLPRIVATE TeleConference* GetConference() const; TUBES_DLLPRIVATE sal_uInt64 GetId() const; + TUBES_DLLPRIVATE void Invite( TpContact* pContact ) const; void DisplayContacts(); void SendFile( TpContact* pContact, const OUString& rURL ) const; diff --git a/tubes/source/collaboration.cxx b/tubes/source/collaboration.cxx index 65c24c546ec3..c957091cf042 100644 --- a/tubes/source/collaboration.cxx +++ b/tubes/source/collaboration.cxx @@ -26,16 +26,20 @@ Collaboration::~Collaboration() mpConference->close(); } -TeleConference* Collaboration::GetConference() const -{ - return mpConference; -} - sal_uInt64 Collaboration::GetId() const { return reinterpret_cast (this); } +void Collaboration::Invite( TpContact* pContact ) const +{ + if (mpConference) + { + mpConference->invite( pContact ); + SaveAndSendFile( pContact ); + } +} + void Collaboration::SendFile( TpContact* pContact, const OUString& rURL ) const { mpConference->sendFile( pContact, rURL, NULL, NULL ); diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx index 1472773f1ec2..2a75f2350ff0 100644 --- a/tubes/source/contacts.cxx +++ b/tubes/source/contacts.cxx @@ -84,12 +84,7 @@ class TubeContacts : public ModelessDialog pAC = static_cast (maList.FirstSelected()->GetUserData()); if (pAC) { - if (mpCollaboration->GetConference()) - { - TpContact* pContact = pAC->second; - mpCollaboration->GetConference()->invite( pContact ); - mpCollaboration->SaveAndSendFile( pContact ); - } + mpCollaboration->Invite( pAC->second ); } }