예제 #1
0
 def _handle_UBN(self, command):  # contact infos
     if not command.payload:
         return
     account, guid = parse_account(command.arguments[0])
     contact = self.__search_account(account)
     type = int(command.arguments[1])
     payload = command.payload
     self.emit("buddy-notification-received", contact, guid, type, payload)
예제 #2
0
 def _handle_UBN(self, command): # contact infos
     if not command.payload:
         return
     account, guid = parse_account(command.arguments[0])
     contact = self.__search_account(account)
     type = int(command.arguments[1])
     payload = command.payload
     self.emit("buddy-notification-received", contact, guid, type, payload)
예제 #3
0
 def _handle_JOI(self, command):
     account, guid = parse_account(command.arguments[0])
     display_name = urllib.unquote(command.arguments[1])
     client_id = command.arguments[2]
     self.__participant_join(account, guid, display_name, client_id)
     if guid is None:
         self.__discard_invitation(account)
         if len(self.__invitations) == 0:
             self._inviting = False
예제 #4
0
 def _handle_JOI(self, command):
     account, guid = parse_account(command.arguments[0])
     display_name = urllib.unquote(command.arguments[1])
     client_id = command.arguments[2]
     self.__participant_join(account, guid, display_name, client_id)
     if guid is None:
         self.__discard_invitation(account)
         if len(self.__invitations) == 0:
             self._inviting = False
예제 #5
0
    def _on_message_received(self, message):
        version = 1
        peer = message.sender
        peer_guid = message.sender_guid

        try:
            dest, dest_guid = parse_account(message.get_header('P2P-Dest'))
        except Exception, err:
            logger.warning("Couldn't parse destination GUID: %s" % err)
            return
예제 #6
0
    def _on_message_received(self, message):
        version = 1
        peer = message.sender
        peer_guid = message.sender_guid

        try:
            dest, dest_guid = parse_account(message.get_header('P2P-Dest'))
        except Exception, err:
            logger.warning("Couldn't parse destination GUID: %s" % err)
            return
예제 #7
0
 def _handle_BYE(self, command):
     account, guid = parse_account(command.arguments[0])
     self.__participant_left(account, guid)
     end_points = self.end_points.get(self._client.profile.account.lower(), [])
     if len(self.participants) == 0 and len(end_points) == 0:
         self.leave()
예제 #8
0
 def _handle_IRO(self, command):
     account, guid = parse_account(command.arguments[2])
     display_name = urllib.unquote(command.arguments[3])
     client_id = command.arguments[4]
     self.__participant_join(account, guid, display_name, client_id)
예제 #9
0
    def _find_contact(self, account):
        account, guid = parse_account(account)
        peer = self._client.address_book.search_or_build_contact(
                account, papyon.profile.NetworkID.MSN)

        return peer, guid
예제 #10
0
    def _find_contact(self, account):
        account, guid = parse_account(account)
        peer = self._client.address_book.search_or_build_contact(
                account, papyon.profile.NetworkID.MSN)

        return peer, guid
예제 #11
0
 def parse_guid(self, header):
     if header not in self.headers:
         return None
     return parse_account(self.headers[header])[1]
예제 #12
0
 def parse_guid(self, header):
     if header not in self.headers:
         return None
     return parse_account(self.headers[header])[1]
예제 #13
0
 def _handle_BYE(self, command):
     account, guid = parse_account(command.arguments[0])
     self.__participant_left(account, guid)
     end_points = self.end_points.get(self._client.profile.account.lower(), [])
     if len(self.participants) == 0 and len(end_points) == 0:
         self.leave()
예제 #14
0
 def _handle_IRO(self, command):
     account, guid = parse_account(command.arguments[2])
     display_name = urllib.unquote(command.arguments[3])
     client_id = command.arguments[4]
     self.__participant_join(account, guid, display_name, client_id)