Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

email_mirror: Move ZulipEmailForwardUserError into email_mirror_helpers.

Alex Vandiverbe669c8d9882
diff --git a/zerver/lib/email_mirror.py b/zerver/lib/email_mirror.py
index a10bda68c59..61471d69cfa 100644
--- a/zerver/lib/email_mirror.py
+++ b/zerver/lib/email_mirror.py
@@ -17,6 +17,7 @@ from zerver.lib.actions import (
)
from zerver.lib.email_mirror_helpers import (
ZulipEmailForwardError,
+ ZulipEmailForwardUserError,
decode_email_address,
get_email_gateway_message_string_from_address,
)
@@ -199,10 +200,6 @@ def construct_zulip_body(
## Sending the Zulip ##
-class ZulipEmailForwardUserError(ZulipEmailForwardError):
- pass
-
-
def send_zulip(sender: UserProfile, stream: Stream, topic: str, content: str) -> None:
internal_send_stream_message(
sender,
diff --git a/zerver/lib/email_mirror_helpers.py b/zerver/lib/email_mirror_helpers.py
index f6dad37d0d9..44558783771 100644
--- a/zerver/lib/email_mirror_helpers.py
+++ b/zerver/lib/email_mirror_helpers.py
@@ -27,6 +27,10 @@ class ZulipEmailForwardError(Exception):
pass
+class ZulipEmailForwardUserError(ZulipEmailForwardError):
+ pass
+
+
def get_email_gateway_message_string_from_address(address: str) -> str:
pattern_parts = [re.escape(part) for part in settings.EMAIL_GATEWAY_PATTERN.split("%s")]
if settings.EMAIL_GATEWAY_EXTRA_PATTERN_HACK: