From a6a62434e060d26a3425ac1e2bd54c7ea0320616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 17 Jun 2019 10:29:23 +0200 Subject: [PATCH] client: Add the context token fetching back for the search. --- pantalaimon/client.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pantalaimon/client.py b/pantalaimon/client.py index 236b0e5..b17925d 100644 --- a/pantalaimon/client.py +++ b/pantalaimon/client.py @@ -745,16 +745,14 @@ class PanClient(AsyncClient): after_limit=after_limit ) - # TODO add the state and start/end tokens - # if event_context or include_state: - # for event_dict in response_dict: - # await add_context( - # event_dict["result"]["room_id"], - # event_dict["result"]["event_id"], - # 0, - # 0, - # include_state - # ) + if event_context or include_state: + for event_dict in response_dict["results"]: + await add_context( + event_dict, + event_dict["result"]["room_id"], + event_dict["result"]["event_id"], + include_state + ) if include_state: response_dict["state"] = state_cache