From 42f5bb619228d193871b160b363578808badf67d Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 9 Jan 2017 23:10:16 +0100 Subject: [PATCH] quick frontends (chat): send actual value instead of None on status and state updates --- frontends/src/quick_frontend/quick_chat.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontends/src/quick_frontend/quick_chat.py b/frontends/src/quick_frontend/quick_chat.py index 91b64a8c..a46e1b45 100644 --- a/frontends/src/quick_frontend/quick_chat.py +++ b/frontends/src/quick_frontend/quick_chat.py @@ -149,9 +149,10 @@ class Message(object): @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 @@ class Occupant(object): @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: