Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_chat.py @ 225:a3162b29cda1
plugin chat: fixed AttributeError when message is receved and a corresponding ChatWidget is not created yet
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 22:23:20 +0200 |
parents | 284cb5c467b0 |
children | ba8f3a4a5ac7 |
comparison
equal
deleted
inserted
replaced
224:ee4d7e923e92 | 225:a3162b29cda1 |
---|---|
209 | 209 |
210 def __init__(self, host, target, type_=C.CHAT_ONE2ONE, nick=None, occupants=None, subject=None, profiles=None): | 210 def __init__(self, host, target, type_=C.CHAT_ONE2ONE, nick=None, occupants=None, subject=None, profiles=None): |
211 quick_chat.QuickChat.__init__(self, host, target, type_, nick, occupants, subject, profiles=profiles) | 211 quick_chat.QuickChat.__init__(self, host, target, type_, nick, occupants, subject, profiles=profiles) |
212 self.otr_state_encryption = OTR_STATE_UNENCRYPTED | 212 self.otr_state_encryption = OTR_STATE_UNENCRYPTED |
213 self.otr_state_trust = OTR_STATE_UNTRUSTED | 213 self.otr_state_trust = OTR_STATE_UNTRUSTED |
214 # completion attributes | |
215 self._hi_comp_data = None | |
216 self._hi_comp_last = None | |
217 self._hi_comp_dropdown = DropDown() | |
218 self._hi_comp_allowed = True | |
214 cagou_widget.CagouWidget.__init__(self) | 219 cagou_widget.CagouWidget.__init__(self) |
215 if type_ == C.CHAT_ONE2ONE: | 220 if type_ == C.CHAT_ONE2ONE: |
216 self.encryption_btn = EncryptionButton(self) | 221 self.encryption_btn = EncryptionButton(self) |
217 self.headerInputAddExtra(self.encryption_btn) | 222 self.headerInputAddExtra(self.encryption_btn) |
218 self.header_input.hint_text = u"{}".format(target) | 223 self.header_input.hint_text = u"{}".format(target) |
219 self.host.addListener('progressError', self.onProgressError, profiles) | 224 self.host.addListener('progressError', self.onProgressError, profiles) |
220 self.host.addListener('progressFinished', self.onProgressFinished, profiles) | 225 self.host.addListener('progressFinished', self.onProgressFinished, profiles) |
221 self._waiting_pids = {} # waiting progress ids | 226 self._waiting_pids = {} # waiting progress ids |
222 self.postInit() | 227 self.postInit() |
223 # completion attribtues | |
224 self._hi_comp_data = None | |
225 self._hi_comp_last = None | |
226 self._hi_comp_dropdown = DropDown() | |
227 self._hi_comp_allowed = True | |
228 | 228 |
229 def __unicode__(self): | 229 def __unicode__(self): |
230 return u"Chat({})".format(self.target) | 230 return u"Chat({})".format(self.target) |
231 | 231 |
232 def __str__(self): | 232 def __str__(self): |