fix some tracebacks when adding / removing a contact. Fixes #5946

This commit is contained in:
Yann Leboulanger 2010-09-28 15:51:26 +02:00
parent efb7f243f4
commit 0f2ddd50c4
2 changed files with 4 additions and 3 deletions

View File

@ -1773,7 +1773,8 @@ ConnectionJingle, ConnectionIBBytestream):
break
if obj.contact:
obj.old_show = statuss.index(obj.contact.show)
if obj.contact.show in statuss:
obj.old_show = statuss.index(obj.contact.show)
# nick changed
if obj.contact_nickname is not None and \
obj.contact.contact_name != obj.contact_nickname:
@ -1800,7 +1801,7 @@ ConnectionJingle, ConnectionIBBytestream):
resource=obj.resource)
gajim.contacts.add_contact(account, obj.contact)
obj.contact_list.append(obj.contact)
else:
elif obj.contact.show in statuss:
obj.old_show = statuss.index(obj.contact.show)
if (resources != [''] and (len(obj.contact_list) != 1 or \
obj.contact_list[0].show != 'offline')) and \

View File

@ -772,7 +772,7 @@ class PresenceReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
gajim.config.set_per('account', self.conn.name,
'dont_ack_subscription', True)
else:
self.dispatch('UNSUBSCRIBED', self.jid)
self.conn.dispatch('UNSUBSCRIBED', self.jid)
elif self.ptype == 'error':
errmsg = self.iq_obj.getError()
errcode = self.iq_obj.getErrorCode()