diff --git a/src/common/events.py b/src/common/events.py index 542c355e5..52cc02986 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -81,7 +81,7 @@ class Events: gajim.interface.systray.set_img() def remove_events(self, account, jid, event = None, types = []): - '''if event is not speficied, remove all events from this jid, + '''if event is not specified, remove all events from this jid, optionnaly only from given type return True if no such event found''' if not self._events.has_key(account): @@ -122,7 +122,7 @@ class Events: return self._get_nb_events(types = types) def get_events(self, account, jid = None, types = []): - '''if event is not speficied, remove all events from this jid, + '''if event is not specified, get all events from this jid, optionnaly only from given type''' if not self._events.has_key(account): return [] diff --git a/src/gajim.py b/src/gajim.py index 7bc35b5d6..4094e9525 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -522,6 +522,7 @@ class Interface: message_control.TYPE_GC: # It's a Private message pm = True + msg_type = 'pm' chat_control = None jid_of_control = full_jid_with_resource @@ -583,14 +584,15 @@ class Interface: # Is it a first or next message received ? first = False - if not chat_control and not gajim.events.get_events(account, - jid_of_control, ['chat']): - # It's a first message and not a Private Message + if msg_type == 'normal': + if not gajim.events.get_events(account,jid, ['normal']): + first = True + elif not chat_control and not gajim.events.get_events(account, + jid_of_control, [msg_type]): # msg_type can be chat or pm first = True if pm: nickname = resource - msg_type = 'pm' groupchat_control.on_private_message(nickname, message, array[2], xhtml) else: