Example #1
0
 def sync_recent_conversations(self, sync_recent_conversations_request):
     """Return info on recent conversations and their events."""
     response = hangouts_pb2.SyncRecentConversationsResponse()
     yield from self._pb_request('conversations/syncrecentconversations',
                                 sync_recent_conversations_request,
                                 response)
     return response
Example #2
0
    def syncrecentconversations(self, max_conversations=100,
                                max_events_per_conversation=1):
        """List the contents of recent conversations, including messages.

        Similar to syncallnewevents, but returns a limited number of
        conversations rather than all conversations in a given date range.

        Can be used to retrieve archived conversations.

        Raises hangups.NetworkError if the request fails.
        """
        request = hangouts_pb2.SyncRecentConversationsRequest(
            request_header=self._get_request_header_pb(),
            max_conversations=max_conversations,
            max_events_per_conversation=max_events_per_conversation,
            sync_filter=[hangouts_pb2.SYNC_FILTER_INBOX],
        )
        response = hangouts_pb2.SyncRecentConversationsResponse()
        yield from self._pb_request('conversations/syncrecentconversations',
                                    request, response)
        return response