From fad6d2ef7e67ba484269384f3fadef90662a1a71 Mon Sep 17 00:00:00 2001
From: Brendan Taylor <bct@diffeq.com>
Date: Mon, 19 May 2008 00:17:39 +0000
Subject: [PATCH] pass session when dispatching MSGNOTSENT

---
 src/common/connection.py                   | 4 ++--
 src/common/zeroconf/connection_zeroconf.py | 2 +-
 src/gajim.py                               | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/common/connection.py b/src/common/connection.py
index 60e2660432..c6daf899ec 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1058,7 +1058,7 @@ class Connection(ConnectionHandlers):
 			if keyID ==  'UNKNOWN':
 				error = _('Neither the remote presence is signed, nor a key was assigned.')
 			elif keyID[8:] == 'MISMATCH':
-				error = _('The contact\'s key (%s) does not match the key assigned in Gajim.' % keyID[:8]) 
+				error = _('The contact\'s key (%s) does not match the key assigned in Gajim.' % keyID[:8])
 			else:
 				#encrypt
 				msgenc, error = self.gpg.encrypt(msg, [keyID])
@@ -1072,7 +1072,7 @@ class Connection(ConnectionHandlers):
 			else:
 				# Encryption failed, do not send message
 				tim = localtime()
-				self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim))
+				self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim, session))
 				return 3
 		if msgtxt and not xhtml and gajim.config.get(
 			'rst_formatting_outgoing_messages'):
diff --git a/src/common/zeroconf/connection_zeroconf.py b/src/common/zeroconf/connection_zeroconf.py
index d306d199b1..18f4250b62 100644
--- a/src/common/zeroconf/connection_zeroconf.py
+++ b/src/common/zeroconf/connection_zeroconf.py
@@ -393,7 +393,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
 			else:
 				# Encryption failed, do not send message
 				tim = time.localtime()
-				self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim))
+				self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim, session))
 				return 3
 
 		if type == 'chat':
diff --git a/src/gajim.py b/src/gajim.py
index 1e20defad6..4330278931 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -1014,9 +1014,9 @@ class Interface:
 			helpers.play_sound('message_sent')
 
 	def handle_event_msgnotsent(self, account, array):
-		#('MSGNOTSENT', account, (jid, ierror_msg, msg, time))
+		#('MSGNOTSENT', account, (jid, ierror_msg, msg, time, session))
 		msg = _('error while sending %s ( %s )') % (array[2], array[1])
-		self.roster.on_message(array[0], msg, array[3], account,
+		array[4].roster_message(array[0], msg, array[3], account,
 			msg_type='error')
 
 	def handle_event_subscribe(self, account, array):
-- 
GitLab