PINGSPEED = 50.0
-DEBUGALL = False
LINEDEBUG = False
MESSAGEDEBUG = False
MSNP2PDEBUG = False
-if DEBUGALL:
- LINEDEBUG = True
- MESSAGEDEBUG = True
- MSNP2PDEBUG = True
-
P2PSEQ = [-3, -2, 0, -1, 1, 2, 3, 4, 5, 6, 7, 8]
def p2pseq(n):
def connectionMade(self):
self.sendCommand('GET', self.path)
self.sendHeader('Authorization', 'Passport1.4 OrgVerb=GET,OrgURL=http://messenger.msn.com,' +
- 'sign-in=%s,pwd=%s,%s' % (quote(self.userHandle), self.passwd,self.authData))
+ 'sign-in=%s,pwd=%s,%s' % (quote(self.userHandle), quote(self.passwd), self.authData))
self.sendHeader('Host', self.host)
self.endHeaders()
self.headers = {}
"""
def __init__(self, s=""):
""" Pass a XML MSNObject string to parse it, or pass no arguments for a null MSNObject to be created. """
+ self.setNull()
if s:
self.parse(s)
- else:
- self.setNull()
def setData(self, creator, imageData):
""" Set the creator and imageData for this object """
if len(cmd) != 3: raise MSNProtocolError, "Invalid Command, %s" % repr(cmd)
if cmd.isdigit():
- if self.ids.has_key(params.split(' ')[0]):
- self.ids[id].errback(int(cmd))
+ id = params.split(' ')[0]
+ if id.isdigit() and self.ids.has_key(int(id)):
+ id = int(id)
+ self.ids[id][0].errback(int(cmd))
del self.ids[id]
return
else: # we received an error which doesn't map to a sent command
screenName = ''
password = ''
passportServer = 'https://nexus.passport.com/rdr/pprdr.asp'
- status = 'FLN'
+ status = 'NLN'
protocol = NotificationClient
maxRetries = 5
"""
cTypes = [s.lstrip() for s in message.getHeader('Content-Type').split(';')]
if self._checkTyping(message, cTypes): return 0
- if 'text/x-msmsgsinvite' in cTypes:
+# if 'text/x-msmsgsinvite' in cTypes:
# header like info is sent as part of the message body.
- info = {}
- for line in message.message.split('\r\n'):
- try:
- key, val = line.split(':')
- info[key] = val.lstrip()
- except ValueError: continue
- if self._checkFileInvitation(message, info): return 0
+# info = {}
+# for line in message.message.split('\r\n'):
+# try:
+# key, val = line.split(':')
+# info[key] = val.lstrip()
+# except ValueError: continue
+# if self._checkFileInvitation(message, info): return 0
elif 'application/x-msnmsgrp2p' in cTypes:
self._handleP2PMessage(message)
return 0
if slpMessage.status == "603":
self.acceptDeferred.callback((False,))
if MSNP2PDEBUG: log.msg("SLPLink is over due to decline, error or BYE")
+ self.data = ""
self.killLink()
def wait_data_ack(self, packet):
self.handlePacket = self.wait_dataprep
def handleSLPMessage(self, slpMessage):
- if slpMessage.status == "200":
+ if slpMessage.method == "INVITE": # The second invite
+ data = {"Bridge" : "TCPv1",\
+ "Listening" : "false",\
+ "Hashed-Nonce": "{00000000-0000-0000-0000-000000000000}"}
+ self.sendSLPMessage("200", "application/x-msnmsgr-transrespbody", data, branch=slpMessage.branch)
+ elif slpMessage.status == "200":
pass
#self.handlePacket = self.wait_dataprep # Moved upwards
else:
301 : "Too many FND responses",
302 : "Not logged in",
+ 400 : "Message not allowed",
402 : "Error accessing contact list",
403 : "Error accessing contact list",