def login(self): global LOGGED_IN LOGGED_IN = False Skype.Skype.OnMessage = self.OnMessage; try: self.skype = Skype.GetSkype(keypair.keyFileName, port = 8964) self.skype.Start() except Exception: raise SystemExit('Unable to create skype instance'); Skype.Account.OnPropertyChange = self.AccountOnChange account = self.skype.GetAccount(self.accountName) account.LoginWithPassword(self.accountPsw, False, False) print "logging in" while LOGGED_IN == False: time.sleep(1) print "logged in"
Skype.ContactSearch.OnPropertyChange = ContactSearchOnChange def ContactSearchOnNewResult(self, contact, rankValue): print(str(rankValue + 1) + '. ' + contact.skypename) Skype.ContactSearch.OnNewResult = ContactSearchOnNewResult #---------------------------------------------------------------------------------- # Creating our main Skype object try: MySkype = Skype.GetSkype(keypair.keyFileName) MySkype.Start() except Exception: raise SystemExit('Unable to create Skype instance') #---------------------------------------------------------------------------------- # Retrieving account and logging in with it. Then waiting in loop. account = MySkype.GetAccount(accountName) print('Logging in with ' + accountName) account.LoginWithPassword(accountPsw, False, False) while loggedIn == False: sleep(1)
def OnMessage(self, message, changesInboxTimestamp, supersedesHistoryMessage, conversation): print conversation.identity, message.author, message.body_xml #if conversation.identity != '#yuiseki/$4425ae72bc11c305': return #if message.author != accountName: # print(message.author_displayname + ': ' + message.body_xml); # if message.body_xml.find('(xss)') != -1: # msg = '(\"\';alert(String.fromCharCode(88,83,83)))()' # conversation.PostText(msg, True); # # !!! conversation.PostText('Automated reply.', False); Skype.Skype.OnMessage = OnMessage try: MySkype = Skype.GetSkype(keypair.keyFileName, port=8888) except Exception: raise SystemExit('Unable to create skype instance') #---------------------------------------------------------------------------------- # Defining our own Account property change callback and assigning it to the # Skype.Account class. def AccountOnChange(self, property_name): global loggedIn #if property_name == 'status': # if self.status == 'LOGGED_IN': # conv = MySkype.GetConversationByIdentity('#yuiseki/$4425ae72bc11c305') # pants = conv.GetParticipants() # for pant in pants: