예제 #1
0
 def _handle_set_typing_notification(self, set_typing_notification):
     """Receive SetTypingNotification and update the conversation."""
     conv_id = set_typing_notification.conversation_id.id
     conv = self._conv_dict.get(conv_id, None)
     if conv is not None:
         res = parsers.parse_typing_status_message(set_typing_notification)
         yield from self.on_typing.fire(res)
         yield from conv.on_typing.fire(res)
     else:
         logger.warning("Received SetTypingNotification for " "unknown conversation {}".format(conv_id))
예제 #2
0
 def _handle_set_typing_notification(self, set_typing_notification):
     """Receive ClientSetTypingNotification and update the conversation."""
     conv_id = set_typing_notification.conversation_id.id_
     conv = self._conv_dict.get(conv_id, None)
     if conv is not None:
         res = parsers.parse_typing_status_message(set_typing_notification)
         yield from self.on_typing.fire(res)
         yield from conv.on_typing.fire(res)
     else:
         logger.warning('Received ClientSetTypingNotification for '
                        'unknown conversation {}'.format(conv_id))
예제 #3
0
 def _handle_set_typing_notification(self, set_typing_notification):
     """Receive ClientSetTypingNotification and update the conversation."""
     conv_id = set_typing_notification.conversation_id.id_
     conv = self._conv_dict.get(conv_id, None)
     if conv is not None:
         res = parsers.parse_typing_status_message(set_typing_notification)
         self.on_typing.fire(res)
         conv.on_typing.fire(res)
     else:
         logger.warning('Received ClientSetTypingNotification for '
                        'unknown conversation {}'.format(conv_id))
예제 #4
0
파일: conversation.py 프로젝트: cp9/hangups
    def _handle_set_typing_notification(self, set_typing_notification):
        """Receive SetTypingNotification and update the conversation.

        Args:
            set_typing_notification: hangouts_pb2.SetTypingNotification
                instance
        """
        conv_id = set_typing_notification.conversation_id.id
        try:
            conv = yield from self._get_or_fetch_conversation(conv_id)
        except exceptions.NetworkError:
            logger.warning(
                'Failed to fetch conversation for typing notification: %s',
                conv_id)
        res = parsers.parse_typing_status_message(set_typing_notification)
        yield from self.on_typing.fire(res)
        yield from conv.on_typing.fire(res)
예제 #5
0
    async def _handle_set_typing_notification(self, set_typing_notification):
        """Receive SetTypingNotification and update the conversation.

        Args:
            set_typing_notification: hangouts_pb2.SetTypingNotification
                instance
        """
        conv_id = set_typing_notification.conversation_id.id
        res = parsers.parse_typing_status_message(set_typing_notification)
        await self.on_typing.fire(res)
        try:
            conv = await self._get_or_fetch_conversation(conv_id)
        except exceptions.NetworkError:
            logger.warning(
                'Failed to fetch conversation for typing notification: %s',
                conv_id
            )
        else:
            await conv.on_typing.fire(res)