webhooks: Update references to "private message" and "PM".

Updates references to "private message" and "PM" to instead be
"direct message".
This commit is contained in:
Lauryn Menard
2023-06-19 16:34:52 +02:00
committed by Tim Abbott
parent 2eeeda7694
commit b75c99b893
5 changed files with 10 additions and 10 deletions

View File

@@ -130,10 +130,10 @@ def check_send_webhook_message(
else: else:
check_send_stream_message(user_profile, client, stream, topic, body) check_send_stream_message(user_profile, client, stream, topic, body)
except StreamDoesNotExistError: except StreamDoesNotExistError:
# A PM will be sent to the bot_owner by check_message, notifying # A direct message will be sent to the bot_owner by check_message,
# that the webhook bot just tried to send a message to a non-existent # notifying that the webhook bot just tried to send a message to a
# stream, so we don't need to re-raise it since it clutters up # non-existent stream, so we don't need to re-raise it since it
# webhook-errors.log # clutters up webhook-errors.log
pass pass

View File

@@ -47,7 +47,7 @@ def api_gosquared_webhook(
# Live chat message event # Live chat message event
elif payload.get("message") is not None and payload.get("person") is not None: elif payload.get("message") is not None and payload.get("person") is not None:
# Only support non-private messages # Only support non-direct messages
if not payload["message"]["private"].tame(check_bool): if not payload["message"]["private"].tame(check_bool):
session_title = payload["message"]["session"]["title"].tame(check_string) session_title = payload["message"]["session"]["title"].tame(check_string)
topic = f"Live chat session - {session_title}" topic = f"Live chat session - {session_title}"

View File

@@ -7,7 +7,7 @@ from zerver.models import get_realm, get_system_bot
class HelloWorldHookTests(WebhookTestCase): class HelloWorldHookTests(WebhookTestCase):
STREAM_NAME = "test" STREAM_NAME = "test"
URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}" URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}"
PM_URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}" DIRECT_MESSAGE_URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}"
WEBHOOK_DIR_NAME = "helloworld" WEBHOOK_DIR_NAME = "helloworld"
# Note: Include a test function per each distinct message condition your integration supports # Note: Include a test function per each distinct message condition your integration supports
@@ -37,7 +37,7 @@ class HelloWorldHookTests(WebhookTestCase):
def test_pm_to_bot_owner(self) -> None: def test_pm_to_bot_owner(self) -> None:
# Note that this is really just a test for check_send_webhook_message # Note that this is really just a test for check_send_webhook_message
self.URL_TEMPLATE = self.PM_URL_TEMPLATE self.URL_TEMPLATE = self.DIRECT_MESSAGE_URL_TEMPLATE
self.url = self.build_webhook_url() self.url = self.build_webhook_url()
expected_message = "Hello! I am happy to be here! :smile:\nThe Wikipedia featured article for today is **[Goodbye](https://en.wikipedia.org/wiki/Goodbye)**" expected_message = "Hello! I am happy to be here! :smile:\nThe Wikipedia featured article for today is **[Goodbye](https://en.wikipedia.org/wiki/Goodbye)**"

View File

@@ -34,7 +34,7 @@ Get Zulip notifications for your TeamCity builds!
When a user runs a personal build, if Zulip can map their TeamCity When a user runs a personal build, if Zulip can map their TeamCity
username to a Zulip user (by comparing it with the Zulip user's email username to a Zulip user (by comparing it with the Zulip user's email
address or full name), that Zulip user will receive a private address or full name), that Zulip user will receive a direct message
message with the result of their personal build. with the result of their personal build.
![](/static/images/integrations/teamcity/002.png) ![](/static/images/integrations/teamcity/002.png)

View File

@@ -109,7 +109,7 @@ def api_teamcity_webhook(
else: else:
topic = build_name topic = build_name
# Check if this is a personal build, and if so try to private message the user who triggered it. # Check if this is a personal build, and if so try to direct message the user who triggered it.
if ( if (
get_teamcity_property_value(message["teamcityProperties"], "env.BUILD_IS_PERSONAL") get_teamcity_property_value(message["teamcityProperties"], "env.BUILD_IS_PERSONAL")
== "true" == "true"