diff --git a/butterfly/connection.py b/butterfly/connection.py index 8ff2a4e..a2e10d1 100644 --- a/butterfly/connection.py +++ b/butterfly/connection.py @@ -51,6 +51,7 @@ class ButterflyConnection(telepathy.server.Connection, _optional_parameters = { 'server' : 's', 'port' : 'q', + 'http-transport' : 'b', 'http-proxy-server' : 's', 'http-proxy-port' : 'q', 'http-proxy-username' : 's', @@ -62,7 +63,8 @@ class ButterflyConnection(telepathy.server.Connection, } _parameter_defaults = { 'server' : 'messenger.hotmail.com', - 'port' : 1863 + 'port' : 1863, + 'http-transport' : False } def __init__(self, manager, parameters): @@ -71,6 +73,7 @@ class ButterflyConnection(telepathy.server.Connection, try: account = unicode(parameters['account']) server = (parameters['server'].encode('utf-8'), parameters['port']) + http_transport = parameters['http-transport'] # Build the proxies configurations proxies = {} @@ -82,7 +85,13 @@ class ButterflyConnection(telepathy.server.Connection, proxies['https'] = proxy self._manager = weakref.proxy(manager) - self._msn_client = papyon.Client(server, proxies) + + if http_transport: + from papyon.transport import HTTPPollConnection + self._msn_client = papyon.Client(server, proxies, HTTPPollConnection) + else: + self._msn_client = papyon.Client(server, proxies) + self._account = (parameters['account'].encode('utf-8'), parameters['password'].encode('utf-8')) self._channel_manager = ChannelManager(self) diff --git a/data/butterfly.manager b/data/butterfly.manager index 5d42219..c023929 100644 --- a/data/butterfly.manager +++ b/data/butterfly.manager @@ -8,6 +8,7 @@ param-account = s required param-password = s required param-server = s param-port = q +param-http-transport = b param-http-proxy-server = s param-http-proxy-port = q param-http-proxy-username = s @@ -18,3 +19,4 @@ param-https-proxy-username = s param-https-proxy-password = s default-server = messenger.hotmail.com default-port = 1863 +default-http-transport = false