summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-08-25 18:34:47 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-08-25 18:34:47 +0100
commit1294d4a3299faba9b5f09ec6f452dfb2ab9f5e35 (patch)
tree399b50b75d5836d88292425721ac5faa40386a47
parentRoot the 3PE lookup API within /_matrix/app/unstable instead of at toplevel (diff)
downloadsynapse-1294d4a3299faba9b5f09ec6f452dfb2ab9f5e35.tar.xz
Move ThirdPartyEntityKind into api.constants so the expectation becomes that the value is significant
-rw-r--r--synapse/api/constants.py5
-rw-r--r--synapse/appservice/api.py2
-rw-r--r--synapse/rest/client/v2_alpha/thirdparty.py2
-rw-r--r--synapse/types.py7
4 files changed, 7 insertions, 9 deletions
diff --git a/synapse/api/constants.py b/synapse/api/constants.py
index 8cf4d6169c..a8123cddcb 100644
--- a/synapse/api/constants.py
+++ b/synapse/api/constants.py
@@ -85,3 +85,8 @@ class RoomCreationPreset(object):
     PRIVATE_CHAT = "private_chat"
     PUBLIC_CHAT = "public_chat"
     TRUSTED_PRIVATE_CHAT = "trusted_private_chat"
+
+
+class ThirdPartyEntityKind(object):
+    USER = "user"
+    LOCATION = "location"
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index 632dc1a4f8..24253e7785 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -14,11 +14,11 @@
 # limitations under the License.
 from twisted.internet import defer
 
+from synapse.api.constants import ThirdPartyEntityKind
 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 ThirdPartyEntityKind
 
 import logging
 import urllib
diff --git a/synapse/rest/client/v2_alpha/thirdparty.py b/synapse/rest/client/v2_alpha/thirdparty.py
index bbc3e9b962..4f6f1a7e17 100644
--- a/synapse/rest/client/v2_alpha/thirdparty.py
+++ b/synapse/rest/client/v2_alpha/thirdparty.py
@@ -18,8 +18,8 @@ import logging
 
 from twisted.internet import defer
 
+from synapse.api.constants import ThirdPartyEntityKind
 from synapse.http.servlet import RestServlet
-from synapse.types import ThirdPartyEntityKind
 from ._base import client_v2_patterns
 
 logger = logging.getLogger(__name__)
diff --git a/synapse/types.py b/synapse/types.py
index fd17ecbbe0..5349b0c450 100644
--- a/synapse/types.py
+++ b/synapse/types.py
@@ -269,10 +269,3 @@ class RoomStreamToken(namedtuple("_StreamToken", "topological stream")):
             return "t%d-%d" % (self.topological, self.stream)
         else:
             return "s%d" % (self.stream,)
-
-
-# Some arbitrary constants used for internal API enumerations. Don't rely on
-# exact values; always pass or compare symbolically
-class ThirdPartyEntityKind(object):
-    USER = 'user'
-    LOCATION = 'location'