summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-03-22 12:59:15 +0000
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:39:32 +0200
commit066479973ce488b0cbf37cf409cd3616661b7943 (patch)
treed2119c09ee9abb6cb0b2e13f1279128abc5aa375 /tubes
parentebc93773e9ec3436f2519651b42b69d39fe4e2e4 (diff)
tubes: make startBuddySession take a TpContact *.
I removed Conference::setTarget() because it's redundant: you can get the target from the channel. And maTarget was unused anyway.
Diffstat (limited to 'tubes')
-rw-r--r--tubes/inc/tubes/conference.hxx3
-rw-r--r--tubes/inc/tubes/manager.hxx10
-rw-r--r--tubes/qa/test_manager.cxx6
-rw-r--r--tubes/source/conference.cxx6
-rw-r--r--tubes/source/manager.cxx11
5 files changed, 13 insertions, 23 deletions
diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx
index 8f68333e940e..b9fd366604a8 100644
--- a/tubes/inc/tubes/conference.hxx
+++ b/tubes/inc/tubes/conference.hxx
@@ -71,8 +71,6 @@ public:
// --- following only to be called only by manager's callbacks ---
// TODO: make friends instead
- /// "buddy@jabber.example.org" or "room@conference.example.org" or "UUID"
- void setTarget( const rtl::OString& rTarget );
void setChannel( TpChannel* pChannel );
TpChannel* getChannel() const { return mpChannel; }
bool offerTube();
@@ -92,7 +90,6 @@ public:
private:
- rtl::OString maTarget;
rtl::OString maSessionId;
TeleManager* mpManager;
TpChannel* mpChannel;
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index c704780d2763..10f20ef2d546 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -105,15 +105,13 @@ public:
/** Start a session with a buddy.
- @param rAccount
- The account (JID) to use. This must be a valid JID that has been
- setup with Empathy or another Telepathy client providing
- Jabber/XMPP.
+ @param pAccount
+ The account to use. This must be a valid Jabber account.
- @param rBuddy
+ @param pBuddy
The buddy to be connected. Must be a contact of rAccount.
*/
- bool startBuddySession( TpAccount *pAccount, const rtl::OString& rBuddy );
+ bool startBuddySession( TpAccount *pAccount, TpContact *pBuddy);
void unregisterConference( TeleConferencePtr pConference );
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index debfef5ef7f1..b053652fbae2 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -224,8 +224,10 @@ void TestTeleTubes::testPrepareAccountManager2()
void TestTeleTubes::testStartBuddySession1()
{
TpAccount *pAcc1 = mpManager1->getAccount(maOffererIdentifier);
- CPPUNIT_ASSERT ( pAcc1 != 0);
- bool bStarted = mpManager1->startBuddySession( pAcc1, maAccepterIdentifier);
+ CPPUNIT_ASSERT( pAcc1 != 0);
+ /* This has to run after testContactList has run successfully. */
+ CPPUNIT_ASSERT( mpAccepterContact != 0);
+ bool bStarted = mpManager1->startBuddySession( pAcc1, mpAccepterContact);
CPPUNIT_ASSERT( bStarted == true);
}
diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx
index f5875e054f86..830db5fa1c67 100644
--- a/tubes/source/conference.cxx
+++ b/tubes/source/conference.cxx
@@ -231,12 +231,6 @@ TeleConference::~TeleConference()
}
-void TeleConference::setTarget( const rtl::OString& rTarget )
-{
- maTarget = rTarget;
-}
-
-
void TeleConference::setChannel( TpChannel* pChannel )
{
OSL_ENSURE( !mpChannel, "TeleConference::setChannel: already have channel");
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index 96c4b3e30572..5497435f233b 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -392,7 +392,7 @@ bool TeleManager::startGroupSession( const rtl::OUString& rUConferenceRoom, cons
/* TODO: factor out common code with startGroupSession() */
-bool TeleManager::startBuddySession( TpAccount *pAccount, const rtl::OString& rBuddy )
+bool TeleManager::startBuddySession( TpAccount *pAccount, TpContact *pBuddy )
{
INFO_LOGGER( "TeleManager::startBuddySession");
@@ -404,16 +404,15 @@ bool TeleManager::startBuddySession( TpAccount *pAccount, const rtl::OString& rB
maConferences.push_back( pConference);
/* TODO: associate the document with this session and conference */
-
- pConference->setTarget( rBuddy);
-
+ const char *pIdentifier = tp_contact_get_identifier( pBuddy);
SAL_INFO( "tubes", "TeleManager::startBuddySession: creating channel request from "
- << tp_account_get_path_suffix( pAccount) << " to " << rBuddy.getStr());
+ << tp_account_get_path_suffix( pAccount)
+ << " to " << pIdentifier);
GHashTable* pRequest = tp_asv_new(
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE,
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, TP_TYPE_HANDLE, TP_HANDLE_TYPE_CONTACT,
- TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, rBuddy.getStr(),
+ TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, pIdentifier,
TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, getFullServiceName().getStr(),
NULL);