comparison frontends/src/quick_frontend/quick_chat.py @ 2075:4f3ebf786fbc

quick_frontend, primitivus (chat): renamed updated to update, using a dict as argument + fixed Primitivus group chat
author Goffi <goffi@goffi.org>
date Thu, 15 Sep 2016 21:58:35 +0200
parents 7834743705f0
children 529a6d7f7f6a
comparison
equal deleted inserted replaced
2074:db5cda61740f 2075:4f3ebf786fbc
140 140
141 @status.setter 141 @status.setter
142 def status(self, status): 142 def status(self, status):
143 self._status = status 143 self._status = status
144 for w in self.widgets: 144 for w in self.widgets:
145 w.updated(["status"]) 145 w.update(["status"])
146 146
147 def handleMe(self): 147 def handleMe(self):
148 """Check if messages starts with "/me " and change them if it is the case 148 """Check if messages starts with "/me " and change them if it is the case
149 149
150 if several messages (different languages) are presents, they all need to start with "/me " 150 if several messages (different languages) are presents, they all need to start with "/me "
210 210
211 @state.setter 211 @state.setter
212 def state(self, new_state): 212 def state(self, new_state):
213 self._state = new_state 213 self._state = new_state
214 for w in self.widgets: 214 for w in self.widgets:
215 w.updated(["state"]) 215 w.update(["state"])
216 216
217 def update(self, key=None): 217 def update(self, update_dict=None):
218 for w in self.widgets: 218 for w in self.widgets:
219 w.update(key) 219 w.update(update_dict)
220 220
221 221
222 class QuickChat(quick_widgets.QuickWidget): 222 class QuickChat(quick_widgets.QuickWidget):
223 visible_states = ['chat_state'] # FIXME: to be removed, used only in quick_games 223 visible_states = ['chat_state'] # FIXME: to be removed, used only in quick_games
224 224
571 mess_data.status = status 571 mess_data.status = status
572 572
573 def onAvatar(self, entity, filename, profile): 573 def onAvatar(self, entity, filename, profile):
574 if self.type == C.CHAT_GROUP: 574 if self.type == C.CHAT_GROUP:
575 if entity.bare == self.target and entity.resource in self.occupants: 575 if entity.bare == self.target and entity.resource in self.occupants:
576 self.occupants[entity.resource].update('avatar') 576 self.occupants[entity.resource].update(['avatar'])
577 for m in self.messages.values(): 577 for m in self.messages.values():
578 if m.nick == entity.resource: 578 if m.nick == entity.resource:
579 for w in m.widgets: 579 for w in m.widgets:
580 w.update('avatar', filename) 580 w.update('avatar', filename)
581 else: 581 else: