Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2010-12-16 09:15:29 +0300
committerYann Leboulanger <asterix@lagaule.org>2010-12-16 09:15:29 +0300
commitd19629ad87acb98a259a0aff5cf50571967b26c3 (patch)
treeab960cc4204fca4b4c5bf4b65311f5d8e5bdf6a1 /src/session.py
parent0c2d703f259c9b3cf1a4c07718640630145ee0ac (diff)
fix traceback when adding a new contact. Fixes #6054
Diffstat (limited to 'src/session.py')
-rw-r--r--src/session.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/session.py b/src/session.py
index 3068f5b7a..cd66ad68a 100644
--- a/src/session.py
+++ b/src/session.py
@@ -106,14 +106,6 @@ 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)
@@ -142,13 +134,14 @@ 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
+ return True
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
+ return True
+ #FIXME Remove after advanced_notif will be removed
if not contact:
# contact is not in the roster, create a fake one to display
# notification
@@ -158,6 +151,14 @@ 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:
@@ -170,6 +171,7 @@ 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, \
@@ -201,8 +203,9 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
msg = obj.msgtxt
if obj.subject:
msg = _('Subject: %s') % obj.subject + '\n' + msg
- focused = False
+ #TODO handled
+ focused = False
if self.control:
parent_win = self.control.parent_win
if parent_win and self.control == parent_win.get_active_control() \