bugfix : we can also receive presences of type error

This commit is contained in:
Yann Leboulanger 2005-02-15 17:35:43 +00:00
parent f0f5475522
commit 427702e877
1 changed files with 3 additions and 3 deletions

View File

@ -2681,7 +2681,7 @@ class plugin:
def handle_event_notify(self, account, array): def handle_event_notify(self, account, array):
#('NOTIFY', account, (jid, status, message, resource, priority, keyID, #('NOTIFY', account, (jid, status, message, resource, priority, keyID,
# role, affiliation, real_jid, reason, actor, statusCode)) # role, affiliation, real_jid, reason, actor, statusCode))
statuss = ['offline', 'online', 'away', 'xa', 'dnd', 'invisible'] statuss = ['offline', 'error', 'online', 'away', 'xa', 'dnd', 'invisible']
old_show = 0 old_show = 0
jid = string.split(array[0], '/')[0] jid = string.split(array[0], '/')[0]
keyID = array[5] keyID = array[5]
@ -2730,10 +2730,10 @@ class plugin:
#It isn't an agent #It isn't an agent
self.roster.chg_user_status(user1, array[1], array[2], account) self.roster.chg_user_status(user1, array[1], array[2], account)
#play sound #play sound
if old_show == 0 and statuss.index(user1.show) > 0 and \ if old_show < 2 and statuss.index(user1.show) > 1 and \
self.config['sound_contact_connected']: self.config['sound_contact_connected']:
self.play_sound('sound_contact_connected') self.play_sound('sound_contact_connected')
elif old_show > 0 and statuss.index(user1.show) == 0 and \ elif old_show > 1 and statuss.index(user1.show) < 2 and \
self.config['sound_contact_disconnected']: self.config['sound_contact_disconnected']:
self.play_sound('sound_contact_disconnected') self.play_sound('sound_contact_disconnected')