From de028e6c8d98dbac13f8f19327e9cd88858ad5e0 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Wed, 22 Sep 2010 10:18:56 +0000 Subject: Revert "Connect to gabble immediatly after registration or when setting a new jabber server #10350" This reverts commit 86ae344e4dab169adc622a8a07f275321d811dd1 which went into branch 0.86 by mistake. --- diff --git a/src/presenceservice.py b/src/presenceservice.py index 4fb6432..84c3cc2 100644 --- a/src/presenceservice.py +++ b/src/presenceservice.py @@ -114,7 +114,17 @@ class PresenceService(ExportedGObject): self._connected_plugins = set() for tp in self._plugins: - self._setup_tp(tp) + self._handles_buddies[tp] = {} + self._activities_by_handle[tp] = {} + + tp.connect('status', self._tp_status_cb) + tp.connect('contacts-online', self._contacts_online) + tp.connect('contacts-offline', self._contacts_offline) + tp.connect('activity-invitation', + 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 = [] @@ -127,19 +137,6 @@ class PresenceService(ExportedGObject): self._bus_name = dbus.service.BusName(_PRESENCE_SERVICE, bus=self._session_bus) - def _setup_tp(self, tp): - self._handles_buddies[tp] = {} - self._activities_by_handle[tp] = {} - - tp.connect('status', self._tp_status_cb) - tp.connect('contacts-online', self._contacts_online) - tp.connect('contacts-offline', self._contacts_offline) - tp.connect('activity-invitation', - self._activity_invitation) - tp.connect('private-invitation', - self._private_invitation) - tp.connect('want-to-connect', self._want_to_connect) - @property def owner(self): return self._owner @@ -861,20 +858,16 @@ class PresenceService(ExportedGObject): self._server_plugin.sync_friends(keys) @dbus.service.method(PRESENCE_INTERFACE, in_signature="", - out_signature="") - def RetryConnections(self): - """Reload configuration and retry connections on all managers.""" - if self._server_plugin is None: - server = self._owner.get_server() - if server and len(server): - tp = ServerPlugin(self._registry, self._owner) - self._setup_tp(tp) - self._server_plugin = tp - self._plugins.append(self._server_plugin) - - for tp in self._plugins: - tp.reload_account_info() - tp.start() + out_signature="") + def RestartServerConnection(self): + """Stop and restart the server_plugin. + + This allows changing jabber servers without restarting Sugar. + """ + if self._server_plugin: + if self._server_plugin.status == CONNECTION_STATUS_CONNECTED: + self._server_plugin.cleanup() + self._server_plugin.start() def main(test_num=0, randomize=False): loop = gobject.MainLoop() diff --git a/src/telepathy_plugin.py b/src/telepathy_plugin.py index 8ad211c..5aca07e 100644 --- a/src/telepathy_plugin.py +++ b/src/telepathy_plugin.py @@ -153,9 +153,6 @@ class TelepathyPlugin(gobject.GObject): self._ip4am_sigid = self._ip4am.connect('address-changed', self._ip4_address_changed_cb) - def reload_account_info(self): - self._account = self._get_account_info() - @property def status(self): """Return the Telepathy connection status.""" -- cgit v0.9.1