changeset 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 ee4d7e923e92
children 1abd9d694e67
files cagou/plugins/plugin_wid_chat.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Tue Jun 26 20:27:45 2018 +0200
+++ b/cagou/plugins/plugin_wid_chat.py	Wed Jun 27 22:23:20 2018 +0200
@@ -211,6 +211,11 @@
         quick_chat.QuickChat.__init__(self, host, target, type_, nick, occupants, subject, profiles=profiles)
         self.otr_state_encryption = OTR_STATE_UNENCRYPTED
         self.otr_state_trust = OTR_STATE_UNTRUSTED
+        # completion attributes
+        self._hi_comp_data = None
+        self._hi_comp_last = None
+        self._hi_comp_dropdown = DropDown()
+        self._hi_comp_allowed = True
         cagou_widget.CagouWidget.__init__(self)
         if type_ == C.CHAT_ONE2ONE:
             self.encryption_btn = EncryptionButton(self)
@@ -220,11 +225,6 @@
         self.host.addListener('progressFinished', self.onProgressFinished, profiles)
         self._waiting_pids = {}  # waiting progress ids
         self.postInit()
-        # completion attribtues
-        self._hi_comp_data = None
-        self._hi_comp_last = None
-        self._hi_comp_dropdown = DropDown()
-        self._hi_comp_allowed = True
 
     def __unicode__(self):
         return u"Chat({})".format(self.target)