Example #1
0
    def adduser(self, conversation_id, chat_id_list,
                otr_status=hangouts_pb2.OFF_THE_RECORD_STATUS_ON_THE_RECORD):
        """Add users to an existing group conversation.

        conversation_id must be a valid conversation ID.
        chat_id_list is list of users which should be invited to conversation.

        Raises hangups.NetworkError if the request fails.
        """
        request = hangouts_pb2.AddUserRequest(
            request_header=self._get_request_header_pb(),
            invitee_id=[hangouts_pb2.InviteeID(gaia_id=chat_id)
                        for chat_id in chat_id_list],
            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.AddUserResponse()
        yield from self._pb_request('conversations/adduser', request, response)
        return response
Example #2
0
 def add_user(self, add_user_request):
     """Invite users to join an existing group conversation."""
     response = hangouts_pb2.AddUserResponse()
     yield from self._pb_request('conversations/adduser',
                                 add_user_request, response)
     return response