From 427702e8773c8ec6ae6636df6a9663e4b69d9f06 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 15 Feb 2005 17:35:43 +0000
Subject: [PATCH] bugfix : we can also receive presences of type error

---
 plugins/gtkgui/gtkgui.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index 1a738b44ca..c75a679111 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -2681,7 +2681,7 @@ class plugin:
 	def handle_event_notify(self, account, array):
 		#('NOTIFY', account, (jid, status, message, resource, priority, keyID, 
 		# 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
 		jid = string.split(array[0], '/')[0]
 		keyID = array[5]
@@ -2730,10 +2730,10 @@ class plugin:
 			#It isn't an agent
 			self.roster.chg_user_status(user1, array[1], array[2], account)
 			#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.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.play_sound('sound_contact_disconnected')
 				
-- 
GitLab