Beispiel #1
0
    def syncallnewevents(self, timestamp):
        """List all events occurring at or after timestamp.

        This method requests protojson rather than json so we have one chat
        message parser rather than two.

        timestamp: datetime.datetime instance specifying the time after
        which to return all events occurring in.

        Raises hangups.NetworkError if the request fails.

        Returns SyncAllNewEventsResponse.
        """
        request = hangouts_pb2.SyncAllNewEventsRequest(
            request_header=self._get_request_header_pb(),
            last_sync_timestamp=parsers.to_timestamp(timestamp),
            max_response_size_bytes=1048576,
        )
        response = hangouts_pb2.SyncAllNewEventsResponse()
        yield from self._pb_request('conversations/syncallnewevents', request,
                                    response)
        return response
Beispiel #2
0
 def sync_all_new_events(self, sync_all_new_events_request):
     """List all events occurring at or after a timestamp."""
     response = hangouts_pb2.SyncAllNewEventsResponse()
     yield from self._pb_request('conversations/syncallnewevents',
                                 sync_all_new_events_request, response)
     return response