apply Alexey's patch in order to be able not to use TLS connection

This commit is contained in:
Yann Leboulanger 2005-05-08 16:50:56 +00:00
parent 4a90f80cfa
commit da4457401f
1 changed files with 2 additions and 2 deletions

View File

@ -167,12 +167,12 @@ class CommonClient:
class Client(CommonClient):
""" Example client class, based on CommonClient. """
def connect(self,server=None,proxy=None):
def connect(self,server=None,proxy=None,tls=1):
""" Connect to jabber server. If you want to specify different ip/port to connect to you can
pass it as tuple as first parameter. If there is HTTP proxy between you and server -
specify it's address and credentials (if needed) in the second argument.
Example: connect(('192.168.5.5':5222),{'host':'proxy.my.net','port':8080,'user':'me','password':'secret'})"""
if not CommonClient.connect(self,server,proxy): return self.connected
if not CommonClient.connect(self,server,proxy) or not tls: return self.connected
transports.TLS().PlugIn(self)
if not self.Dispatcher.Stream._document_attrs.has_key('version') or not self.Dispatcher.Stream._document_attrs['version']=='1.0': return self.connected
while not self.Dispatcher.Stream.features and self.Process(): pass # If we get version 1.0 stream the features tag MUST BE presented