fix receiving single messages

This commit is contained in:
Yann Leboulanger 2013-10-28 11:23:54 +01:00
parent b801667628
commit cab5228220
2 changed files with 11 additions and 3 deletions

View File

@ -2717,7 +2717,14 @@ class RosterWindow:
return True
if obj.mtype not in ('normal', 'chat'):
return
if obj.session.control:
if obj.mtype == 'normal' and obj.popup:
# it's single message to be autopopuped
dialogs.SingleMessageWindow(obj.conn.name, obj.jid,
action='receive', from_whom=obj.jid, subject=obj.subject,
message=obj.msgtxt, resource=obj.resource, session=obj.session,
form_node=obj.form_node)
return
if obj.session.control and obj.mtype == 'chat':
typ = ''
if obj.mtype == 'error':
typ = 'error'
@ -2734,7 +2741,7 @@ class RosterWindow:
if not pw or (pw.get_active_control() and obj.session.control \
== pw.get_active_control() and pw.is_active() and end):
gajim.logger.set_read_messages([obj.msg_id])
elif obj.popup:
elif obj.popup and obj.mtype == 'chat':
contact = gajim.contacts.get_contact(obj.conn.name, obj.jid)
obj.session.control = gajim.interface.new_chat(contact,
obj.conn.name, session=obj.session)

View File

@ -237,7 +237,8 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
obj.show_in_systray = notify.get_show_in_systray(event_type,
self.conn.name, contact)
if not self.control:
if (not self.control and obj.mtype != 'normal') or \
(obj.mtype != 'normal' and not obj.popup):
event = gajim.events.create_event(type_, (obj.msgtxt, obj.subject,
obj.mtype, obj.timestamp, obj.encrypted, obj.resource,
obj.msg_id, obj.xhtml, self, obj.form_node, obj.displaymarking,