Esempio n. 1
0
 def ymsg_avatar(self,hdr,pay):
     if pay[0].has_key(4):
         for each in pay:
             if pay[each].has_key(4):
                 if pay[each].has_key(198):
                     if pay[each][198] == '1' and pay[each].has_key(197):
                         b = avatar.getavatar(pay[each][197], self.dumpProtocol)
                         if b != None and self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self,pay[each][4],b)
                     elif pay[each][198] == '0':
                         if self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self,pay[each][4],None)
Esempio n. 2
0
 def ymsg_avatar(self, hdr, pay):
     if pay[0].has_key(4):
         for each in pay:
             if pay[each].has_key(4):
                 if pay[each].has_key(198):
                     if pay[each][198] == '1' and pay[each].has_key(197):
                         b = avatar.getavatar(pay[each][197],
                                              self.dumpProtocol)
                         if b != None and self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self, pay[each][4], b)
                     elif pay[each][198] == '0':
                         if self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self, pay[each][4],
                                                     None)
Esempio n. 3
0
 def ymsg_online(self, hdr, pay):
     if pay[0].has_key(7):
         for each in pay:
             status = None
             if pay[each].has_key(10):
                 if pay[each][10] == '99':
                     if pay[each].has_key(19):
                         status = unicode(pay[each][19], 'utf-8', 'replace')
             if pay[each].has_key(7):
                 typ = None
                 if pay[each].has_key(47):
                     if pay[each][47] == '1':
                         typ = 'dnd'
                     elif pay[each][47] == '2':
                         typ = 'away'
                 self.roster[pay[each][7]] = ('available', typ, status)
                 if pay[each].has_key(198):
                     if pay[each][198] == '1' and pay[each].has_key(197):
                         b = avatar.getavatar(pay[each][197],
                                              self.dumpProtocol)
                         if b != None and self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self, pay[each][7], b)
                     elif pay[each][198] == '0':
                         if self.handlers.has_key('avatar'):
                             self.handlers['avatar'](self, pay[each][7],
                                                     None)
                 if pay[each].has_key(13):
                     i = int(pay[each][13])
                     j = i % 4
                     k = j % 2
                     if i / 4:
                         if self.dumpProtocol: print "contact is on games"
                     if j / 2:
                         if not self.resources.has_key(pay[each][7]):
                             self.resources[pay[each][7]] = []
                         if self.resources.has_key(pay[each][7]):
                             if not 'chat' in self.resources[pay[each][7]]:
                                 self.resources[pay[each][7]].append('chat')
                         if self.handlers.has_key('chatonline'):
                             self.handlers['chatonline'](self, pay[each][7])
                     if k:
                         if not self.resources.has_key(pay[each][7]):
                             self.resources[pay[each][7]] = []
                         if self.resources.has_key(pay[each][7]):
                             if not 'messenger' in self.resources[pay[each]
                                                                  [7]]:
                                 self.resources[pay[each][7]].append(
                                     'messenger')
                         if self.handlers.has_key('online'):
                             self.handlers['online'](self, pay[each][7])
Esempio n. 4
0
    def ymsg_online(self,hdr,pay):
        if pay[0].has_key(7):
            for each in pay:
                typ = None
                status = None
                if pay[each].has_key(10):
                    (typ, status) = self.determine_typ_status(pay[each])

                if pay[each].has_key(7):
                    self.roster[pay[each][7]]=('available', typ, status)
                    if pay[each].has_key(198):
                        if pay[each][198] == '1' and pay[each].has_key(197):
                            b = avatar.getavatar(pay[each][7], self.dumpProtocol)
                            if b != None and self.handlers.has_key('avatar'):
                                self.handlers['avatar'](self,pay[each][7],b)
                        elif pay[each][198] == '0':
                            if self.handlers.has_key('avatar'):
                                self.handlers['avatar'](self,pay[each][7],None)
                    if pay[each].has_key(13):
                        i = int(pay[each][13])
                        j = i%4
                        k= j%2
                        if i/4:
                            if self.dumpProtocol: print "contact is on games"
                        if j/2:
                            if not self.resources.has_key(pay[each][7]):
                                self.resources[pay[each][7]]=[]
                            if self.resources.has_key(pay[each][7]):
                                if not 'chat' in self.resources[pay[each][7]]:
                                    self.resources[pay[each][7]].append('chat')
                            if self.handlers.has_key('chatonline'):
                                self.handlers['chatonline'](self,pay[each][7])
                        if k:
                            if not self.resources.has_key(pay[each][7]):
                                self.resources[pay[each][7]]=[]
                            if self.resources.has_key(pay[each][7]):
                                if not 'messenger' in self.resources[pay[each][7]]:
                                    self.resources[pay[each][7]].append('messenger')
                            if self.handlers.has_key('online'):
                                self.handlers['online'](self,pay[each][7])