changeset c8b9ae19a10b in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gtk3 details:http://hg.gajim.org/gajim?cmd=changeset;node=c8b9ae19a10b description: fix receiving single messages
diffstat:
src/roster_window.py | 11 +++++++++-- src/session.py | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-)
diffs (41 lines):
diff -r 7ac6cbe85087 -r c8b9ae19a10b src/roster_window.py --- a/src/roster_window.py Sat Oct 26 00:05:09 2013 +0400 +++ b/src/roster_window.py Mon Oct 28 11:23:54 2013 +0100 @@ -2717,7 +2717,14 @@ 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 @@ 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) diff -r 7ac6cbe85087 -r c8b9ae19a10b src/session.py --- a/src/session.py Sat Oct 26 00:05:09 2013 +0400 +++ b/src/session.py Mon Oct 28 11:23:54 2013 +0100 @@ -237,7 +237,8 @@ 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,