Philipp Hörist pushed to branch master at gajim / gajim
Commits: 6f6edbef by lovetox at 2020-08-14T21:32:30+02:00 StatusChange: Correctly publish mood/activity
- - - - -
2 changed files:
- gajim/common/app.py - gajim/gtk/status_change.py
Changes:
===================================== gajim/common/app.py ===================================== @@ -382,14 +382,8 @@ def get_number_of_connected_accounts(accounts_list=None): connected_accounts = connected_accounts + 1 return connected_accounts
-def get_available_clients(account=None): +def get_available_clients(): clients = [] - if account is not None: - client = connections.get(account) - if client is None or not client.state.is_available: - return [] - return [client] - for client in connections.values(): if client.state.is_available: clients.append(client)
===================================== gajim/gtk/status_change.py ===================================== @@ -511,10 +511,15 @@ class StatusChange(Gtk.ApplicationWindow, TimeoutWindow): if self._ui.mood_switch.get_active(): mood = self._pep_dict['mood']
- for client in app.get_available_clients(self.account): - if not app.config.get_per('accounts', client.account, - 'sync_with_global_status'): - continue + if self.account is None: + for client in app.get_available_clients(): + if not app.config.get_per('accounts', client.account, + 'sync_with_global_status'): + continue + client.set_user_mood(mood) + + else: + client = app.get_client(self.account) client.set_user_mood(mood)
def _send_user_activity(self): @@ -523,10 +528,15 @@ class StatusChange(Gtk.ApplicationWindow, TimeoutWindow): activity = (self._pep_dict['activity'], self._pep_dict['subactivity'])
- for client in app.get_available_clients(self.account): - if not app.config.get_per('accounts', client.account, - 'sync_with_global_status'): - continue + if self.account is None: + for client in app.get_available_clients(): + if not app.config.get_per('accounts', client.account, + 'sync_with_global_status'): + continue + client.set_user_activity(activity) + + else: + client = app.get_client(self.account) client.set_user_activity(activity)
def _send_status_and_message(self, message):
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/6f6edbef2bee95cb2cf8d7182773e0ef9...