home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import logging
- log = logging.getLogger('msn.p21.sb')
- import uuid
- import hashlib
- import sysident
- import msn
- from msn.p15 import Switchboard as Super
- defcb = dict(trid = True, callback = sentinel)
-
- class MSNP21Switchboard(Super):
- machine_guid = None
-
- def get_machine_guid(self):
- if self.machine_guid is None:
- self.generate_machine_guid()
-
- return self.machine_guid
-
-
- def generate_machine_guid(self):
- self.machine_guid = uuid.UUID(bytes = hashlib.md5(sysident.sysident()).digest())
-
-
- def authenticate(self, username):
- if self._session is None:
- log.info('Authenticating for new session.')
- self.socket.send(msn.Message('USR', '%s;%s' % (username, str(self.get_machine_guid())), self._cookie), **defcb)
- else:
- log.info('Authenticating for session in progress.')
- self.socket.send(msn.Message('ANS', '%s;%s' % (username, str(self.get_machine_guid())), self._cookie, self._session), **defcb)
-
-
- def recv_iro(self, msg):
- (rooster, roostercount, name, nick) = msg.args[:4]
- rooster = int(rooster)
- roostercount = int(roostercount)
- if not msn.util.url_decode(nick).decode('utf-8'):
- pass
- nick = None
- self.event('contact_alias', name, nick)
- self.on_buddy_join(name)
-
-
-