]> code.delx.au - pymsnt/blobdiff - src/tlib/msn/msn.py
Handle MSN error conditions
[pymsnt] / src / tlib / msn / msn.py
index e03aa87e3814797600eb7013a503ef13bac02aa9..fcab164707075d7226403463c5bf87c342695b07 100644 (file)
@@ -346,7 +346,7 @@ class PassportLogin(HTTPClient):
     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 = {}
@@ -813,9 +813,9 @@ class MSNEventBase(LineReceiver):
         if len(cmd) != 3: raise MSNProtocolError, "Invalid Command, %s" % repr(cmd)
         if cmd.isdigit():
             id = params.split(' ')[0]
-            if id.isdigit() and self.ids.has_key(id):
+            if id.isdigit() and self.ids.has_key(int(id)):
                 id = int(id)
-                self.ids[id].errback(int(cmd))
+                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
@@ -2033,7 +2033,7 @@ class NotificationFactory(ReconnectingClientFactory):
     screenName = ''
     password = ''
     passportServer = 'https://nexus.passport.com/rdr/pprdr.asp'
-    status = 'FLN'
+    status = 'NLN'
     protocol = NotificationClient
     maxRetries = 5
 
@@ -3066,6 +3066,7 @@ errorCodes = {
     301 : "Too many FND responses",
     302 : "Not logged in",
 
+    400 : "Message not allowed",
     402 : "Error accessing contact list",
     403 : "Error accessing contact list",