]> code.delx.au - pymsnt/blobdiff - src/tlib/msn/msnw.py
Partially working with new msnw
[pymsnt] / src / tlib / msn / msnw.py
index 1da75ee70be8fc72ae20692d1d5fa557b614ff14..202b94057c744809362b154f432b2d487d23af7d 100644 (file)
@@ -13,9 +13,6 @@ import math, base64, binascii, math
 from debug import LogEvent, INFO, WARN, ERROR
 from tlib.msn import msn
 
-# Imports from msn
-from msn import FORWARD_LIST, ALLOW_LIST, BLOCK_LIST, REVERSE_LIST, PENDING_LIST
-from msn import STATUS_ONLINE, STATUS_OFFLINE, STATUS_HIDDEN, STATUS_IDLE, STATUS_AWAY, STATUS_BUSY, STATUS_BRB, STATUS_PHONE, STATUS_LUNCH
 
 MAXMESSAGESIZE     = 1400
 SWITCHBOARDTIMEOUT = 30.0*60.0
@@ -39,6 +36,7 @@ class MSNConnection:
                self.password = password
                self.ident = ident
                self.timeout = None
+               self.notificationClient = None
                self.connect()
                LogEvent(INFO, self.ident)
        
@@ -189,7 +187,7 @@ class MSNConnection:
 
                if self.notificationClient:
                        count = 0
-                       def cb():
+                       def cb(ignored=None):
                                if count == 3:
                                        self.ourStatusChanged(statusCode, screenName, personal)
                        LogEvent(INFO, self.ident)
@@ -328,6 +326,7 @@ class NotificationClient(msn.NotificationClient):
                LogEvent(INFO, self.factory.msncon.ident)
                msn.NotificationClient.loggedIn(self, userHandle, verified)
                self.factory.msncon._notificationClientReady(self)
+               self.factory.msncon.loggedIn()
                if not verified:
                        self.factory.msncon.accountNotVerified()
        
@@ -511,7 +510,7 @@ class OneSwitchboardSession(SwitchboardSessionBase, msn.SwitchboardClient):
        def __init__(self, msncon, remoteUser):
                SwitchboardSessionBase.__init__(self, msncon)
                msn.SwitchboardClient.__init__(self)
-               self.remoteUser = remoteUser
+               self.remoteUser = str(remoteUser)
                self.ident = (self.msncon, self.remoteUser)
                self.chattingUsers = []
                self.timeout = None
@@ -575,7 +574,7 @@ class OneSwitchboardSession(SwitchboardSessionBase, msn.SwitchboardClient):
        def sendTypingNotification(self):
                LogEvent(INFO, self.ident)
                if self.ready:
-                       msn.SwitchboaldClient.sendTypingNotification(self)
+                       msn.SwitchboardClient.sendTypingNotification(self)
        
        CAPS = msn.MSNContact.MSNC1 | msn.MSNContact.MSNC2 | msn.MSNContact.MSNC3 | msn.MSNContact.MSNC4
        def sendAvatarRequest(self):