From f2fb177d7def135a2b4002a49ded7dbdd2448ddf Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 17 Jun 2019 23:06:28 -0700 Subject: [PATCH] modules/client/publicrooms: Refresh the cache on request. fixes #82 --- modules/client/publicrooms.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/client/publicrooms.cc b/modules/client/publicrooms.cc index 22221d87c..2d60218d5 100644 --- a/modules/client/publicrooms.cc +++ b/modules/client/publicrooms.cc @@ -92,6 +92,20 @@ get__publicrooms(client &client, request.get("include_all_networks", false) }; + if(server && !my_host(server)) try + { + m::rooms::fetch_update(server, since, limit); + } + catch(const std::exception &e) + { + log::error + { + m::log, "Failed to fetch public rooms from '%s' :%s", + server, + e.what() + }; + } + resource::response::chunked response { client, http::OK