Mercurial > libervia-backend
changeset 2115:3435e8d2e8e4
quick frontends (chat): send actual value instead of None on status and state updates
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 09 Jan 2017 23:10:16 +0100 |
parents | dc5d214f0a3b |
children | 766dbbec56f2 |
files | frontends/src/quick_frontend/quick_chat.py |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_chat.py Thu Jan 05 22:22:26 2017 +0100 +++ b/frontends/src/quick_frontend/quick_chat.py Mon Jan 09 23:10:16 2017 +0100 @@ -149,9 +149,10 @@ @status.setter def status(self, status): - self._status = status - for w in self.widgets: - w.update({"status": None}) + if status != self._status: + self._status = status + for w in self.widgets: + w.update({"status": status}) def handleMe(self): """Check if messages starts with "/me " and change them if it is the case @@ -219,9 +220,10 @@ @state.setter def state(self, new_state): - self._state = new_state - for w in self.widgets: - w.update({"state":None}) + if new_state != self._state: + self._state = new_state + for w in self.widgets: + w.update({"state": new_state}) def update(self, update_dict=None): for w in self.widgets: