From f32fb6555246adec537bfbca1ddca19e8fe5f4ba Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 6 Dec 2016 10:43:48 +0000 Subject: Add new API appservice specific public room list --- synapse/appservice/api.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'synapse/appservice/api.py') diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py index b0eb0c6d9d..17dfc8e98c 100644 --- a/synapse/appservice/api.py +++ b/synapse/appservice/api.py @@ -19,6 +19,7 @@ from synapse.api.errors import CodeMessageException from synapse.http.client import SimpleHttpClient from synapse.events.utils import serialize_event from synapse.util.caches.response_cache import ResponseCache +from synapse.types import ThirdPartyInstanceID import logging import urllib @@ -177,6 +178,14 @@ class ApplicationServiceApi(SimpleHttpClient): " valid result", uri) defer.returnValue(None) + for instance in info.get("instances", []): + instance["appservice_id"] = service.id + network_id = instance.get("network_id", None) + if network_id is not None: + instance["network_id"] = ThirdPartyInstanceID( + service.id, network_id, + ).to_string() + defer.returnValue(info) except Exception as ex: logger.warning("query_3pe_protocol to %s threw exception %s", -- cgit 1.4.1 From 3727d66a0efac721765dbb1959d520a9a89da5b9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 6 Dec 2016 17:04:26 +0000 Subject: Don't include appservice id --- synapse/appservice/api.py | 1 - 1 file changed, 1 deletion(-) (limited to 'synapse/appservice/api.py') diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py index 17dfc8e98c..aefbda34ba 100644 --- a/synapse/appservice/api.py +++ b/synapse/appservice/api.py @@ -179,7 +179,6 @@ class ApplicationServiceApi(SimpleHttpClient): defer.returnValue(None) for instance in info.get("instances", []): - instance["appservice_id"] = service.id network_id = instance.get("network_id", None) if network_id is not None: instance["network_id"] = ThirdPartyInstanceID( -- cgit 1.4.1 From 2bf5a47b3e07bc80dd3a99e1c460f9f0a2fce95e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 12 Dec 2016 14:46:13 +0000 Subject: Rename network_id to instance_id on client side --- synapse/appservice/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/appservice/api.py') diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py index aefbda34ba..6893610e71 100644 --- a/synapse/appservice/api.py +++ b/synapse/appservice/api.py @@ -181,7 +181,7 @@ class ApplicationServiceApi(SimpleHttpClient): for instance in info.get("instances", []): network_id = instance.get("network_id", None) if network_id is not None: - instance["network_id"] = ThirdPartyInstanceID( + instance["instance_id"] = ThirdPartyInstanceID( service.id, network_id, ).to_string() -- cgit 1.4.1