path: root/tubes/inc
diff options
authorMatúš Kukan <>2012-07-20 00:12:19 +0200
committerMatúš Kukan <>2012-07-20 12:46:59 +0200
commit37c67a137882cc1a9e113552dcab42a7d6337358 (patch)
tree5c1fa1c471f1719e70240a61689e8c9672771326 /tubes/inc
parentd41903eb7b6936bbf98639d39ddc7558409d63be (diff)
tubes: send a file for collaboration when buddy session starts
Channels for file and for tube are independent in telepathy, so let sender create UUID and pass it to receiver, who then can bind the document to the channel. UUID for tube channel goes through telepathy. UUID for file channel is encoded in the filename for now. Tubes specific CreateDocFunc is re-introduced, so we could set current UUID after file is received and when the document is being constructed, get channel from TeleManager with this UUID. This is not immune to constructing other documents in the middle of binding proccess. Change-Id: I57c7e57a5d7d3ccd7d94677a8cf2719c78baa2fd
Diffstat (limited to 'tubes/inc')
3 files changed, 16 insertions, 4 deletions
diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx
index b35fddc4c5bb..29d4cefa2b04 100644
--- a/tubes/inc/tubes/conference.hxx
+++ b/tubes/inc/tubes/conference.hxx
@@ -47,7 +47,7 @@ class TeleConference
- TeleConference( TeleManager* pManager, TpAccount *pAccount, TpDBusTubeChannel* pChannel );
+ TeleConference( TeleManager* pManager, TpAccount *pAccount, TpDBusTubeChannel* pChannel, const OString sUuid = OString() );
/// Close channel and call finalize()
@@ -77,6 +77,7 @@ public:
typedef void (*FileSentCallback)( bool aSuccess, void* pUserData);
TUBES_DLLPUBLIC void sendFile( rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData);
+ TUBES_DLLPUBLIC const OString& getUuid() const { return msUuid; }
// --- following only to be called only by manager's callbacks ---
// TODO: make friends instead
@@ -112,6 +113,7 @@ private:
TeleManager* mpManager;
TpAccount* mpAccount;
TpDBusTubeChannel* mpChannel;
+ OString msUuid;
gchar* mpAddress;
GDBusConnection* mpTube;
guint maObjectRegistrationId;
diff --git a/tubes/inc/tubes/constants.h b/tubes/inc/tubes/constants.h
index 447910ecec34..5c34534c8e37 100644
--- a/tubes/inc/tubes/constants.h
+++ b/tubes/inc/tubes/constants.h
@@ -45,6 +45,10 @@
* tp_simple_handler_new_with_am(). */
#define LIBO_CLIENT_SUFFIX "LibreOffice"
+/* Key value storing UUID for TeleConference
+ */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index 4e0e3b42bced..9f1689148ac3 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -40,6 +40,7 @@
#include <tools/link.hxx>
#include <telepathy-glib/telepathy-glib.h>
#include <tubes/warnings_guard_boost_signals2.hpp>
+#include <map>
// For testing purposes, we might need more in future.
#define LIBO_TUBES_DBUS_INTERFACE "org.libreoffice.calc"
@@ -131,12 +132,16 @@ public:
TUBES_DLLPUBLIC TeleConference* startBuddySession( TpAccount *pAccount, TpContact *pBuddy );
+ /** Get a conference with current UUID to set a session. */
+ TUBES_DLLPUBLIC TeleConference* getConference();
+ /** True if there has been tube channel received and is still not used. */
+ TUBES_DLLPUBLIC static bool hasWaitingConference();
void disconnect();
boost::signals2::signal<void ( const rtl::OUString &localUri )> sigFileReceived;
- boost::signals2::signal<void (TeleConference*)> sigConferenceCreated;
/// Only for use with MainLoopFlusher
GMainLoop* getMainLoop() const;
@@ -184,7 +189,7 @@ public:
is something like org.libreoffice.calc, this modifies the names to
"LibreOffice"+pName and "org.libreoffice.calc"+pName to make tests not
interfere with the real world. This is not to be used otherwise. If
- used it must be called before the first TeleManager is instanciated and
+ used it must be called before the first TeleManager is instanciated and
static void addSuffixToNames( const char* pName );
@@ -205,6 +210,7 @@ public:
gpointer pUserData);
+ void addConference( TeleConference* );
void ensureLegacyChannel( TpAccount* pAccount, TpContact* pBuddy );
bool mbChannelReadyHandlerInvoked : 1;