summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-14 13:32:56 +0100
committerNeil Johnson <neil@matrix.org>2018-08-14 13:32:56 +0100
commite2c9fe0a6a6dbe4f81402b79b6605e17fb05e5d4 (patch)
treebad367e8638e754765f4c817770ab06beb8493b3 /synapse
parentsupport server notice state events for resource limits (diff)
downloadsynapse-e2c9fe0a6a6dbe4f81402b79b6605e17fb05e5d4.tar.xz
backout ability to pass in event type to server notices
Diffstat (limited to 'synapse')
-rw-r--r--synapse/server_notices/consent_server_notices.py2
-rw-r--r--synapse/server_notices/resource_limits_server_notices.py3
-rw-r--r--synapse/server_notices/server_notices_manager.py4
3 files changed, 5 insertions, 4 deletions
diff --git a/synapse/server_notices/consent_server_notices.py b/synapse/server_notices/consent_server_notices.py
index 6d5caedb08..783ceae1ad 100644
--- a/synapse/server_notices/consent_server_notices.py
+++ b/synapse/server_notices/consent_server_notices.py
@@ -104,7 +104,7 @@ class ConsentServerNotices(object):
                     },
                 )
                 yield self._server_notices_manager.send_notice(
-                    user_id, content, EventTypes.Message
+                    user_id, content
                 )
                 yield self._store.user_set_consent_server_notice_sent(
                     user_id, self._current_consent_version,
diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py
index 2f49dae168..0470f66205 100644
--- a/synapse/server_notices/resource_limits_server_notices.py
+++ b/synapse/server_notices/resource_limits_server_notices.py
@@ -91,6 +91,7 @@ class ResourceLimitsServerNotices(object):
                     self._send_server_notice(user_id, content)
                     self._notified_of_blocking.add(user_id)
 
+
     @defer.inlineCallbacks
     def _send_server_notice(self, user_id, content):
         """Sends Server notice
@@ -104,7 +105,7 @@ class ResourceLimitsServerNotices(object):
         """
         try:
             yield self._server_notices_manager.send_notice(
-                user_id, content, EventTypes.ServerNoticeLimitReached
+                user_id, content
             )
         except SynapseError as e:
             logger.error("Error sending server notice about resource limits: %s", e)
diff --git a/synapse/server_notices/server_notices_manager.py b/synapse/server_notices/server_notices_manager.py
index 4806977a89..a26deace53 100644
--- a/synapse/server_notices/server_notices_manager.py
+++ b/synapse/server_notices/server_notices_manager.py
@@ -46,7 +46,7 @@ class ServerNoticesManager(object):
         return self._config.server_notices_mxid is not None
 
     @defer.inlineCallbacks
-    def send_notice(self, user_id, event_content, type):
+    def send_notice(self, user_id, event_content):
         """Send a notice to the given user
 
         Creates the server notices room, if none exists.
@@ -67,7 +67,7 @@ class ServerNoticesManager(object):
 
         yield self._event_creation_handler.create_and_send_nonmember_event(
             requester, {
-                "type": type,
+                "type": EventTypes.Message,
                 "room_id": room_id,
                 "sender": system_mxid,
                 "content": event_content,