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.

integrations: Use consistent code boundaries in GitHub notifications.

Satyam Bansal22fa5a7ee3d5
diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.py
index 4547ac23aad..9fd53436093 100644
--- a/zerver/webhooks/github/tests.py
+++ b/zerver/webhooks/github/tests.py
@@ -435,9 +435,9 @@ Check [randscape](http://github.com/github/hello-world/runs/4) completed (succes
expected_topic = "team Testing"
expected_message = """\
**Hypro999** changed the team description to:
-```quote
+\n~~~ quote
A temporary team so that I can get some webhook fixtures!
-```"""
+~~~"""
self.check_webhook("team__edited_description", expected_topic, expected_message)
def test_team_edited_name(self) -> None:
@@ -575,9 +575,9 @@ A temporary team so that I can get some webhook fixtures!
self.assertTrue(stack_info)
def test_discussion_msg(self) -> None:
- expected_message = "Codertocat created [discussion #90](https://github.com/baxterthehacker/public-repo/discussions/90) in General:\n```quote\n### Welcome to discussions!\nWe're glad to have you here!\n```"
+ expected_message = "Codertocat created [discussion #90](https://github.com/baxterthehacker/public-repo/discussions/90) in General:\n\n~~~ quote\n### Welcome to discussions!\nWe're glad to have you here!\n~~~"
self.check_webhook("discussion", TOPIC_DISCUSSION, expected_message)
def test_discussion_comment_msg(self) -> None:
- expected_message = "Codertocat [commented](https://github.com/baxterthehacker/public-repo/discussions/90#discussioncomment-544078) on [discussion #90](https://github.com/baxterthehacker/public-repo/discussions/90):\n```quote\nI have so many questions to ask you!\n```"
+ expected_message = "Codertocat [commented](https://github.com/baxterthehacker/public-repo/discussions/90#discussioncomment-544078) on [discussion #90](https://github.com/baxterthehacker/public-repo/discussions/90):\n\n~~~ quote\nI have so many questions to ask you!\n~~~"
self.check_webhook("discussion_comment", TOPIC_DISCUSSION, expected_message)
diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.py
index fdd1d3e0632..b4d173b3797 100644
--- a/zerver/webhooks/github/view.py
+++ b/zerver/webhooks/github/view.py
@@ -35,8 +35,8 @@ from zerver.models import UserProfile
fixture_to_headers = get_http_headers_from_filename("HTTP_X_GITHUB_EVENT")
TOPIC_FOR_DISCUSSION = "{repo} discussion #{number}: {title}"
-DISCUSSION_TEMPLATE = "{author} created [discussion #{discussion_id}]({url}) in {category}:\n```quote\n### {title}\n{body}\n```"
-DISCUSSION_COMMENT_TEMPLATE = "{author} [commented]({comment_url}) on [discussion #{discussion_id}]({discussion_url}):\n```quote\n{body}\n```"
+DISCUSSION_TEMPLATE = "{author} created [discussion #{discussion_id}]({url}) in {category}:\n\n~~~ quote\n### {title}\n{body}\n~~~"
+DISCUSSION_COMMENT_TEMPLATE = "{author} [commented]({comment_url}) on [discussion #{discussion_id}]({discussion_url}):\n\n~~~ quote\n{body}\n~~~"
class Helper:
@@ -396,7 +396,7 @@ def get_team_body(helper: Helper) -> str:
if "description" in changes:
actor = get_sender_name(payload)
new_description = payload["team"]["description"].tame(check_string)
- return f"**{actor}** changed the team description to:\n```quote\n{new_description}\n```"
+ return f"**{actor}** changed the team description to:\n\n~~~ quote\n{new_description}\n~~~"
if "name" in changes:
original_name = changes["name"]["from"].tame(check_string)
new_name = payload["team"]["name"].tame(check_string)