diff --git a/src/common/xmpp/dispatcher_nb.py b/src/common/xmpp/dispatcher_nb.py
index 515a09d..4f982d9 100644
--- a/src/common/xmpp/dispatcher_nb.py
+++ b/src/common/xmpp/dispatcher_nb.py
@@ -126,6 +126,38 @@ class Dispatcher(PlugIn):
 			1) length of processed data if some data were processed;
 			2) '0' string if no data were processed but link is alive;
 			3) 0 (zero) if underlying connection is closed.'''
+
+		# XXX UNBOUND NAMESPACE PREFIX HACK XXX
+		if not hasattr(self, 'drop_chars_until_we_get_an_end_tag_named'):
+			self.drop_chars_until_we_get_an_end_tag_named = None
+
+		if self.drop_chars_until_we_get_an_end_tag_named:
+			self.buffer += data
+
+			import re
+			seeker = re.compile('</'+self.drop_chars_until_we_get_an_end_tag_named+'>')
+			match = seeker.search(self.buffer)
+
+			if match:
+				# found the stanza end tag. drop everything before it and continue
+				data = self.buffer[match.end():]
+				self.drop_chars_until_we_get_an_end_tag_named = None
+				self.buffer = ''
+
+				self.Stream = simplexml.NodeBuilder()
+				self.Stream._dispatch_depth = 2
+				self.Stream.dispatch = self.dispatch
+				self.Stream.stream_header_received = self._check_stream_start
+				self._owner.debug_flags.append(simplexml.DBG_NODEBUILDER)
+				self.Stream.DEBUG = self._owner.DEBUG
+				self.Stream.features = None
+
+				self.Stream.Parse("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>")
+			else:
+				return len(data)
+
+		# END HACK
+
 		for handler in self._cycleHandlers: 
 			handler(self)
 		if len(self._pendingExceptions) > 0:
@@ -138,9 +170,24 @@ class Dispatcher(PlugIn):
 				self._owner.Connection.disconnect()
 				return 0
 		except ExpatError:
-			self.DEBUG('Invalid XML received from server. Forcing disconnect.', 'error')
-			self._owner.Connection.pollend()
-			return 0
+			# XXX THIS IS A TEMPORARY FIX XXX
+			# XXX SINCE SOME SERVERS WILL ACCEPT MESSAGES WITH UNBOUND NAMESPACE PREFIXES XXX
+
+			# dropping parts of the stream is *not* a long-term solution
+
+			self.DEBUG('Invalid XML received from server. Hackishly trying to recover.', 'error')
+
+			self.drop_chars_until_we_get_an_end_tag_named = self.Stream._mini_dom.name
+
+			self.buffer = data
+
+			return len(data)
+
+			# END HACK
+
+			# XXX uncomment this when we're no longer hacking around this issue XXX
+			#self._owner.Connection.pollend()
+			#return 0
 		if len(self._pendingExceptions) > 0:
 			 _pendingException = self._pendingExceptions.pop()
 			 raise _pendingException[0], _pendingException[1], _pendingException[2]
