コード例 #1
0
    def rename(self, name):
        """Rename the conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Raises hangups.NetworkError if conversation cannot be renamed.
        """
        yield from self._client.rename_conversation(
            hangouts_pb2.RenameConversationRequest(
                request_header=self._client.get_request_header(),
                new_name=name,
                event_request_header=self._get_event_request_header(),
            ))
コード例 #2
0
    async def rename(self, name):
        """Rename this conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be renamed.
        """
        await self._client.rename_conversation(
            hangouts_pb2.RenameConversationRequest(
                request_header=self._client.get_request_header(),
                new_name=name,
                event_request_header=self._get_event_request_header(),
            ))
コード例 #3
0
    def renameconversation(
            self, conversation_id, name,
            otr_status=hangouts_pb2.OFF_THE_RECORD_STATUS_ON_THE_RECORD):
        """Rename a conversation.

        Raises hangups.NetworkError if the request fails.
        """
        request = hangouts_pb2.RenameConversationRequest(
            request_header=self._get_request_header_pb(),
            new_name=name,
            event_request_header=hangouts_pb2.EventRequestHeader(
                conversation_id=hangouts_pb2.ConversationId(
                    id=conversation_id,
                ),
                client_generated_id=self.get_client_generated_id(),
                expected_otr=otr_status,
            ),
        )
        response = hangouts_pb2.RenameConversationResponse()
        yield from self._pb_request('conversations/renameconversation',
                                    request, response)
        return response