diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2010-12-19 12:52:56 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2010-12-19 12:52:56 +0300 |
commit | 48a44e0cfe6bcc44b0c4d88870aa73502a0ce678 (patch) | |
tree | e2967280f4e2846a4a5e7addae94ca351b06fd0a /src/session.py | |
parent | 2cdd95d6c6332eca275e508a0f09384b8582fd48 (diff) |
revert unwanted commits from in 63c35c953516
Diffstat (limited to 'src/session.py')
-rw-r--r-- | src/session.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/session.py b/src/session.py index cd66ad68a..3068f5b7a 100644 --- a/src/session.py +++ b/src/session.py @@ -106,6 +106,14 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): pm = True obj.mtype = 'pm' + highest_contact = gajim.contacts.get_contact_with_highest_priority( + self.conn.name, obj.jid) + + # does this resource have the highest priority of any available? + is_highest = not highest_contact or not highest_contact.resource or \ + obj.resource == highest_contact.resource or highest_contact.show ==\ + 'offline' + # Handle chat states contact = gajim.contacts.get_contact(self.conn.name, obj.jid, obj.resource) @@ -134,14 +142,13 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): # THIS MUST BE AFTER chatstates handling # AND BEFORE playsound (else we ear sounding on chatstates!) if not obj.msgtxt: # empty message text - return True + return if gajim.config.get_per('accounts', self.conn.name, 'ignore_unknown_contacts') and not gajim.contacts.get_contacts( self.conn.name, obj.jid) and not pm: - return True + return - #FIXME Remove after advanced_notif will be removed if not contact: # contact is not in the roster, create a fake one to display # notification @@ -151,14 +158,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): advanced_notif_num = notify.get_advanced_notification( 'message_received', self.conn.name, contact) - highest_contact = gajim.contacts.get_contact_with_highest_priority( - self.conn.name, obj.jid) - - # does this resource have the highest priority of any available? - is_highest = not highest_contact or not highest_contact.resource or \ - obj.resource == highest_contact.resource or highest_contact.show ==\ - 'offline' - if not pm and is_highest: jid_of_control = obj.jid else: @@ -171,7 +170,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): self.control = ctrl self.control.set_session(self) - #TODO handled # Is it a first or next message received ? first = False if not self.control and not gajim.events.get_events(self.conn.name, \ @@ -203,9 +201,8 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): msg = obj.msgtxt if obj.subject: msg = _('Subject: %s') % obj.subject + '\n' + msg - - #TODO handled focused = False + if self.control: parent_win = self.control.parent_win if parent_win and self.control == parent_win.get_active_control() \ |