comparison sat_frontends/primitivus/primitivus @ 2900:93dfbeb41da8

primitivus: don't call chatStateComposing when host is out of sync: if host is out of sync, that means that server is not connected and it makes no sense to call this method. Furthermore, this was resulting in a crash because profile is not found.
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2019 21:09:51 +0200
parents 26edcf3a30eb
children ce52ac2fe213
comparison
equal deleted inserted replaced
2899:5b0f897689b7 2900:93dfbeb41da8
178 self.host._updateInputHistory(self.get_edit_text(), mode=self.mode) 178 self.host._updateInputHistory(self.get_edit_text(), mode=self.mode)
179 else: 179 else:
180 if (self._mode == C.MODE_INSERTION 180 if (self._mode == C.MODE_INSERTION
181 and isinstance(self.host.selected_widget, quick_chat.QuickChat) 181 and isinstance(self.host.selected_widget, quick_chat.QuickChat)
182 and key not in sat_widgets.FOCUS_KEYS 182 and key not in sat_widgets.FOCUS_KEYS
183 and key not in (a_key['HISTORY_PREV'], a_key['HISTORY_NEXT'])): 183 and key not in (a_key['HISTORY_PREV'], a_key['HISTORY_NEXT'])
184 and self.host.sync):
184 self.host.bridge.chatStateComposing(self.host.selected_widget.target, self.host.selected_widget.profile) 185 self.host.bridge.chatStateComposing(self.host.selected_widget.target, self.host.selected_widget.profile)
185 186
186 return super(EditBar, self).keypress(size, key) 187 return super(EditBar, self).keypress(size, key)
187 188
188 189