sc/source/ui/collab/collab.cxx |4 +--
sc/source/ui/collab/sendfunc.cxx |5 ++--
sc/source/ui/inc/collab.hxx |2 -
tubes/inc/tubes/manager.hxx |7 --
tubes/qa/test_manager.cxx|4 +--
tubes/source/manager.cxx | 40 ---
6 files changed, 50 insertions(+), 12 deletions(-)
New commits:
commit 602fae9a0d2984790b1c5be8ac607990f4168202
Author: Will Thompson will.thomp...@collabora.co.uk
Date: Mon Mar 26 14:40:17 2012 +0100
tubes: work around âWe are supposed to handle only one channelâ bug.
This is the bug which breaks the first request after the offerer signed
in.
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index c75e3c1..8ba3a02 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -221,6 +221,8 @@ public:
static void TransferDone( EmpathyFTHandler *handler,
TpFileTransferChannel *, gpointer user_data);
private:
+voidensureLegacyChannel( TpAccount* pAccount,
TpContact* pBuddy );
+
TeleConferenceVectormaConferences;
boolmbAcceptIncoming;
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index 21d0d41..73895f9 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -592,11 +592,41 @@ bool TeleManager::startGroupSession( const rtl::OUString
rUConferenceRoom, cons
#endif
+void TeleManager::ensureLegacyChannel( TpAccount* pAccount, TpContact* pBuddy )
+{
+/* This is a workaround for a Telepathy bug.
+ * https://bugs.freedesktop.org/show_bug.cgi?id=47760. The first time you
+ * request a tube to a contact on an account, you actually get two channels
+ * back: the tube you asked for, along with a legacy Channel.Type.Tubes
+ * object. This breaks create_and_handle_channel_async(), which expects to
+ * only get one channel back.
+ *
+ * To work around this, we make sure the legacy Tubes channel already
+ * exists before we request the channel we actually want. We don't actually
+ * have to wait for this request to succeedâwe fire it off and forget
about
+ * it.
+ */
+GHashTable* pRequest = tp_asv_new(
+TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TP_IFACE_CHANNEL_TYPE_TUBES,
+TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, TP_TYPE_HANDLE,
TP_HANDLE_TYPE_CONTACT,
+TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING,
tp_contact_get_identifier (pBuddy),
+NULL);
+TpAccountChannelRequest* pChannelRequest = tp_account_channel_request_new(
+pAccount, pRequest, TP_USER_ACTION_TIME_NOT_USER_ACTION);
+tp_account_channel_request_ensure_channel_async( pChannelRequest, NULL,
+NULL, NULL, NULL );
+g_object_unref( pChannelRequest );
+g_hash_table_unref( pRequest );
+}
+
+
/* TODO: factor out common code with startGroupSession() */
bool TeleManager::startBuddySession( TpAccount *pAccount, TpContact *pBuddy )
{
INFO_LOGGER( TeleManager::startBuddySession);
+ensureLegacyChannel( pAccount, pBuddy );
+
OString aSessionId( TeleManager::createUuid());
TeleConferencePtr pConference( new TeleConference( this, NULL, NULL,
aSessionId));
commit 2ab2ac613510cf16c4cdfb8f2ac31815de56956e
Author: Will Thompson will.thomp...@collabora.co.uk
Date: Mon Mar 26 14:22:25 2012 +0100
tubes: quick hack to allow running two instances
To record a screencast, I wanted to get two instances of LibreOffice
running in the same session. But the Client object(s) claim D-Bus names,
so initializing the second instance failed.
This patch changes things so that if LIBO_TUBES=master, no Client
objects are created. As a result, only the slave can receive files.
diff --git a/sc/source/ui/collab/collab.cxx b/sc/source/ui/collab/collab.cxx
index 4c02045..a03f4f8 100644
--- a/sc/source/ui/collab/collab.cxx
+++ b/sc/source/ui/collab/collab.cxx
@@ -66,9 +66,9 @@ void ScCollaboration::packetReceivedCallback( TeleConference
*pConference, TeleP
sigPacketReceived( pConference, aString);
}
-bool ScCollaboration::initManager()
+bool ScCollaboration::initManager(bool bAcceptIncoming)
{
-mpManager = TeleManager::get();
+mpManager = TeleManager::get(bAcceptIncoming);
mpManager-sigPacketReceived.connect(
boost::bind( ScCollaboration::packetReceivedCallback, this, _1, _2 ));
mpManager-connect();
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 0f74209..3dddabf 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -557,8 +557,9 @@ SC_DLLPRIVATE ScDocFunc *ScDocShell::CreateDocFunc()
boost::bind( ScDocFuncRecv::packetReceived, pReceiver, _1, _2 ));
pCollab-sigFileReceived.connect(
boost::bind( ScDocFuncRecv::fileReceived, pReceiver, _1));
-bOk = bOk pCollab-initManager();
-