we now bug user when he wants to go invisible and he is in rooms

This commit is contained in:
Yann Leboulanger 2005-09-13 17:53:31 +00:00
parent 95fc6741a8
commit 50a179b301
1 changed files with 32 additions and 4 deletions

View File

@ -1279,7 +1279,19 @@ _('If "%s" accepts this request you will know his status.') %jid)
message = dlg.run() message = dlg.run()
return message return message
def connected_rooms(self, account):
accounts = gajim.connections.keys()
if True in gajim.gc_connected[account].values():
return True
return False
def change_status(self, widget, account, status): def change_status(self, widget, account, status):
if status == 'invisible':
if self.connected_rooms(account):
dialog = dialogs.ConfirmationDialog(_('You are connected in rooms'),
_('Changiing status to invisible will disconnect you from all your rooms. Are you sure you want to go invisible?'))
if dialog.get_response() != gtk.RESPONSE_OK:
return
message = self.get_status_message(status) message = self.get_status_message(status)
if message == -1: if message == -1:
return return
@ -1299,15 +1311,31 @@ _('If "%s" accepts this request you will know his status.') %jid)
self.update_status_comboxbox() self.update_status_comboxbox()
return return
status = model[active][2].decode('utf-8') status = model[active][2].decode('utf-8')
message = self.get_status_message(status)
if message == -1:
self.update_status_comboxbox()
return
one_connected = False one_connected = False
for acct in accounts: for acct in accounts:
if gajim.connections[acct].connected > 1: if gajim.connections[acct].connected > 1:
one_connected = True one_connected = True
break break
if status == 'invisible':
bug_user = False
for acct in accounts:
if not one_connected or gajim.connections[acct].connected > 1:
if not gajim.config.get_per('accounts', acct,
'sync_with_global_status'):
continue
# We're going ti change our status to invisible
if self.connected_rooms(acct):
bug_user = True
break
if bug_user:
dialog = dialogs.ConfirmationDialog(_('You are connected in rooms'),
_('Changiing status to invisible will disconnect you from all your rooms. Are you sure you want to go invisible?'))
if dialog.get_response() != gtk.RESPONSE_OK:
return
message = self.get_status_message(status)
if message == -1:
self.update_status_comboxbox()
return
for acct in accounts: for acct in accounts:
if not gajim.config.get_per('accounts', acct, if not gajim.config.get_per('accounts', acct,
'sync_with_global_status'): 'sync_with_global_status'):