]> code.delx.au - pymsnt/blobdiff - src/legacy/msnw.py
Fixed a silly bug in cosmetic changes.
[pymsnt] / src / legacy / msnw.py
index 0644246d30ddc1f52d04829744f2f7333aa0a37e..89471af38ea9e41ed97834bea065c7710c8fc032 100644 (file)
@@ -186,6 +186,9 @@ class MSNConnection:
        def gotAvatarImage(self, to, image):
                pass
        
+       def gotSendRequest(self, fileReceive):
+               pass
+       
        def listSynchronized(self):
                pass
        
@@ -269,7 +272,7 @@ class SwitchboardSessionBase:
        def sendMessage(self, message, noerror):
                if self.ready:
                        def failedMessage(ignored):
-                               if self.__class__ == GroupchatSwitchboardSession:
+                               if isinstance(self, GroupchatSwitchboardSession):
                                        tempmsncon.failedMessage(self.groupchat.roomJID(), message)
                                else:
                                        tempmsncon.failedMessage(self.remoteUser, message)
@@ -315,6 +318,9 @@ class SwitchboardSessionBase:
        
        def gotAvatarImage(self, to, image):
                self.msncon.gotAvatarImage(to, image)
+       
+       def gotSendRequest(self, fileReceive):
+               self.msncon.gotSendRequest(fileReceive)
 
        def switchboardReady(self, switchboard):
                LogEvent(INFO, self.ident)
@@ -724,7 +730,7 @@ class Switchboard(msn.SwitchboardClient):
        
        def loggedIn(self):
                if self.badConditions(): return
-               if (not self.reply) and self.switchboardSession.__class__ == SwitchboardSession:
+               if (not self.reply) and isinstance(self.switchboardSession, SwitchboardSession):
                        def failCB(arg=None):
                                LogEvent(INFO, ident, "User has not joined after 30 seconds.")
                                self.switchboardSession.removeMe()
@@ -791,7 +797,7 @@ class Switchboard(msn.SwitchboardClient):
        
        def userTyping(self, message):
                if self.badConditions(): return
-               if self.switchboardSession.__class__ == SwitchboardSession: # Ignore typing in groupchats
+               if isinstance(self.switchboardSession, SwitchboardSession): # Ignore typing in groupchats
                        if message.userHandle == self.switchboardSession.remoteUser:
                                self.switchboardSession.contactTyping()
        
@@ -815,5 +821,12 @@ class Switchboard(msn.SwitchboardClient):
        def gotAvatarImage(self, to, image):
                if self.badConditions(): return
                self.switchboardSession.gotAvatarImage(to, image)
+       
+       def gotSendRequest(self, fileReceive):
+               if self.badConditions():
+                       fileReceive.accept(False)
+                       return
+               LogEvent(INFO, self.switchboardSession.ident)
+               self.switchboardSession.gotSendRequest(fileReceive)