quick_frontend, primitivus (chat): fixed widget bad locking + don't send notification when locked

This commit is contained in:
Goffi 2016-07-24 17:59:24 +02:00
commit 9f853cd774
2 changed files with 6 additions and 1 deletions

View file

@ -442,6 +442,11 @@ class Chat(PrimitivusWidget, quick_chat.QuickChat):
# notifications
if self._locked:
# we don't want notifications when locked
# because that's history messages
return
if wid.mess_data.mention:
from_jid = wid.mess_data.from_jid
msg = _(u'You have been mentioned by {nick} in {room}'.format(

View file

@ -153,7 +153,7 @@ class QuickChat(quick_widgets.QuickWidget):
"""
self.lang = '' # default language to use for messages
quick_widgets.QuickWidget.__init__(self, host, target, profiles=profiles)
self._locked = False # True when we are waiting for history/search
self._locked = True # True when we are waiting for history/search
# messageNew signals are cached when locked
self._cache = []
assert type_ in (C.CHAT_ONE2ONE, C.CHAT_GROUP)