Author: js
Date: 2008-07-16 17:50:51 +0200 (Wed, 16 Jul 2008)
New Revision: 9945
Modified:
trunk/src/common/config.py
trunk/src/gajim.py
trunk/src/roster_window.py
Log:
Keep last status on autoconnect.
Modified: trunk/src/common/config.py
===================================================================
--- trunk/src/common/config.py 2008-07-16 12:58:52 UTC (rev 9944)
+++ trunk/src/common/config.py 2008-07-16 15:50:51 UTC (rev 9945)
@@ -270,7 +270,6 @@
'autopriority_dnd': [ opt_int, 20],
'autopriority_invisible': [ opt_int, 10],
'autoconnect': [ opt_bool, False, '', True ],
- 'autoconnect_as': [ opt_str, 'online', _('Status used to autoconnect as. Can be online, chat, away, xa, dnd, invisible.'), True ],
'autoreconnect': [ opt_bool, True ],
'active': [ opt_bool, True],
'proxy': [ opt_str, '', '', True ],
@@ -308,6 +307,8 @@
'msgwin-height': [opt_int, 440],
'listen_to_network_manager' : [opt_bool, True],
'is_zeroconf': [opt_bool, False],
+ 'last_status': [opt_str, 'online'],
+ 'last_status_msg': [opt_str, ''],
'zeroconf_first_name': [ opt_str, '', '', True ],
'zeroconf_last_name': [ opt_str, '', '', True ],
'zeroconf_jabber_id': [ opt_str, '', '', True ],
Modified: trunk/src/gajim.py
===================================================================
--- trunk/src/gajim.py 2008-07-16 12:58:52 UTC (rev 9944)
+++ trunk/src/gajim.py 2008-07-16 15:50:51 UTC (rev 9945)
@@ -2706,22 +2706,13 @@
def autoconnect(self):
'''auto connect at startup'''
# dict of account that want to connect sorted by status
- shows = {}
for a in gajim.connections:
if gajim.config.get_per('accounts', a, 'autoconnect'):
- show = gajim.config.get_per('accounts', a, 'autoconnect_as')
- if not show in gajim.SHOW_LIST:
- continue
- if not show in shows:
- shows[show] = [a]
- else:
- shows[show].append(a)
- for show in shows:
- message = self.roster.get_status_message(show)
- if message is None:
- continue
- for a in shows[show]:
- self.roster.send_status(a, show, message)
+ self.roster.send_status(a,
+ gajim.config.get_per('accounts', a,
+ 'last_status'),
+ gajim.config.get_per('accounts', a,
+ 'last_status_msg'))
return False
def show_systray(self):
Modified: trunk/src/roster_window.py
===================================================================
--- trunk/src/roster_window.py 2008-07-16 12:58:52 UTC (rev 9944)
+++ trunk/src/roster_window.py 2008-07-16 15:50:51 UTC (rev 9945)
@@ -1726,6 +1726,11 @@
def send_status(self, account, status, txt, auto = False, to = None):
child_iterA = self._get_account_iter(account, self.model)
if status != 'offline':
+ if to is None:
+ gajim.config.set_per('accounts', account,
+ 'last_status', status)
+ gajim.config.set_per('accounts', account,
+ 'last_status_msg', txt)
if gajim.connections[account].connected < 2:
self.set_connecting_state(account)