Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/common/app.py
    ... ... @@ -382,14 +382,8 @@ def get_number_of_connected_accounts(accounts_list=None):
    382 382
                 connected_accounts = connected_accounts + 1
    
    383 383
         return connected_accounts
    
    384 384
     
    
    385
    -def get_available_clients(account=None):
    
    385
    +def get_available_clients():
    
    386 386
         clients = []
    
    387
    -    if account is not None:
    
    388
    -        client = connections.get(account)
    
    389
    -        if client is None or not client.state.is_available:
    
    390
    -            return []
    
    391
    -        return [client]
    
    392
    -
    
    393 387
         for client in connections.values():
    
    394 388
             if client.state.is_available:
    
    395 389
                 clients.append(client)
    

  • gajim/gtk/status_change.py
    ... ... @@ -511,10 +511,15 @@ class StatusChange(Gtk.ApplicationWindow, TimeoutWindow):
    511 511
             if self._ui.mood_switch.get_active():
    
    512 512
                 mood = self._pep_dict['mood']
    
    513 513
     
    
    514
    -        for client in app.get_available_clients(self.account):
    
    515
    -            if not app.config.get_per('accounts', client.account,
    
    516
    -                                      'sync_with_global_status'):
    
    517
    -                continue
    
    514
    +        if self.account is None:
    
    515
    +            for client in app.get_available_clients():
    
    516
    +                if not app.config.get_per('accounts', client.account,
    
    517
    +                                          'sync_with_global_status'):
    
    518
    +                    continue
    
    519
    +                client.set_user_mood(mood)
    
    520
    +
    
    521
    +        else:
    
    522
    +            client = app.get_client(self.account)
    
    518 523
                 client.set_user_mood(mood)
    
    519 524
     
    
    520 525
         def _send_user_activity(self):
    
    ... ... @@ -523,10 +528,15 @@ class StatusChange(Gtk.ApplicationWindow, TimeoutWindow):
    523 528
                 activity = (self._pep_dict['activity'],
    
    524 529
                             self._pep_dict['subactivity'])
    
    525 530
     
    
    526
    -        for client in app.get_available_clients(self.account):
    
    527
    -            if not app.config.get_per('accounts', client.account,
    
    528
    -                                      'sync_with_global_status'):
    
    529
    -                continue
    
    531
    +        if self.account is None:
    
    532
    +            for client in app.get_available_clients():
    
    533
    +                if not app.config.get_per('accounts', client.account,
    
    534
    +                                          'sync_with_global_status'):
    
    535
    +                    continue
    
    536
    +                client.set_user_activity(activity)
    
    537
    +
    
    538
    +        else:
    
    539
    +            client = app.get_client(self.account)
    
    530 540
                 client.set_user_activity(activity)
    
    531 541
     
    
    532 542
         def _send_status_and_message(self, message):