From afe189973761162a187daaee9932279b2c0c00b5 Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Thu, 01 Nov 2007 12:03:19 +0000 Subject: #2412: Improvements to connection watching after smcv review --- diff --git a/src/telepathy_plugin.py b/src/telepathy_plugin.py index 26ca8fb..9ec0321 100644 --- a/src/telepathy_plugin.py +++ b/src/telepathy_plugin.py @@ -243,11 +243,11 @@ class TelepathyPlugin(gobject.GObject): If the connection disappears, stop the plugin. """ if not dbus_name: - if self._conn_status == CONNECTION_STATUS_CONNECTED: - _logger.debug('telepathy connection %s lost: stopping %s', - self._conn.service_name, self._TP_CONN_MANAGER) - self._conn = None - self._stop() + _logger.warning('telepathy connection %s lost: stopping %s', + self._conn.service_name, self._TP_CONN_MANAGER) + self._handle_connection_status_change( + CONNECTION_STATUS_DISCONNECTED, + CONNECTION_STATUS_REASON_NONE_SPECIFIED) def _handle_connection_status_change(self, status, reason): if status == self._conn_status: @@ -291,6 +291,9 @@ class TelepathyPlugin(gobject.GObject): self._matches = [] for match in matches: match.remove() + if self._watch_conn_name is not None: + self._watch_conn_name.cancel() + self._watch_conn_name = None if self._conn: try: -- cgit v0.9.1