Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/presenceservice.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/presenceservice.py')
-rw-r--r--src/presenceservice.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/presenceservice.py b/src/presenceservice.py
index 02a5ba4..0c51f61 100644
--- a/src/presenceservice.py
+++ b/src/presenceservice.py
@@ -125,6 +125,7 @@ class PresenceService(ExportedGObject):
self._activity_invitation)
tp.connect('private-invitation',
self._private_invitation)
+ tp.connect('want-to-connect', self._want_to_connect)
tp.start()
self._contacts_online_queue = []
@@ -572,6 +573,19 @@ class PresenceService(ExportedGObject):
self.PrivateInvitation(str(conn.service_name), conn.object_path,
chan_path)
+ def _want_to_connect(self, plugin):
+ if plugin == self._ll_plugin:
+ # Link-local plugin can connect only if the Server plugin isn't
+ # connected
+ if not self._server_plugin or \
+ self._server_plugin.status != CONNECTION_STATUS_CONNECTED:
+ plugin.start()
+
+ elif plugin == self._server_plugin:
+ # Server plugin can always try to connect
+ plugin.start()
+
+
@dbus.service.signal(PRESENCE_INTERFACE, signature="o")
def ActivityAppeared(self, activity):
pass