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: Remove "Yo".

David Rosa217915a50c67
diff --git a/static/images/integrations/yo-app/001.png b/static/images/integrations/yo-app/001.png
deleted file mode 100644
index 166f67c49b6..00000000000
Binary files a/static/images/integrations/yo-app/001.png and /dev/null differ
diff --git a/static/images/integrations/yo-app/002.png b/static/images/integrations/yo-app/002.png
deleted file mode 100644
index 1fb5d90b015..00000000000
Binary files a/static/images/integrations/yo-app/002.png and /dev/null differ
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py
index 428f85ec0ec..8689440350c 100644
--- a/zerver/lib/integrations.py
+++ b/zerver/lib/integrations.py
@@ -464,12 +464,6 @@ WEBHOOK_INTEGRATIONS: List[WebhookIntegration] = [
WebhookIntegration("trello", ["project-management"]),
WebhookIntegration("updown", ["monitoring"]),
WebhookIntegration("uptimerobot", ["monitoring"], display_name="UptimeRobot"),
- WebhookIntegration(
- "yo",
- ["communication"],
- function="zerver.webhooks.yo.view.api_yo_app_webhook",
- display_name="Yo",
- ),
WebhookIntegration("wekan", ["productivity"], display_name="Wekan"),
WebhookIntegration("wordpress", ["marketing"], display_name="WordPress"),
WebhookIntegration("zapier", ["meta-integration"]),
@@ -816,14 +810,6 @@ DOC_SCREENSHOT_CONFIG: Dict[str, List[BaseScreenshotConfig]] = {
"uptimerobot": [ScreenshotConfig("uptimerobot_monitor_up.json")],
"wekan": [ScreenshotConfig("add_comment.json")],
"wordpress": [ScreenshotConfig("publish_post.txt", "wordpress_post_created.png")],
- "yo": [
- ScreenshotConfig(
- "",
- "002.png",
- "yo-app",
- extra_params={"email": "[email protected]", "username": "Cordelia"},
- )
- ],
"zabbix": [ScreenshotConfig("zabbix_alert.json")],
"zendesk": [
ScreenshotConfig(
diff --git a/zerver/webhooks/yo/__init__.py b/zerver/webhooks/yo/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/zerver/webhooks/yo/doc.md b/zerver/webhooks/yo/doc.md
deleted file mode 100644
index 0fa92d6edb3..00000000000
--- a/zerver/webhooks/yo/doc.md
+++ /dev/null
@@ -1,28 +0,0 @@
-See your Yo notifications in Zulip!
-
-1. First, on your {{ settings_html|safe }}, create a bot for
- {{ integration_display_name }}. Construct the URL for the
- {{ integration_display_name }} bot using the bot API key
- and the email address associated with your Zulip account:
-
- `{{ api_url }}{{ integration_url }}?api_key=abcdefgh&[email protected]`
-
-1. Modify the parameters of the URL above, where `api_key` is the API key
- of your Zulip bot.
-
-1. You will receive your notifications as a private message from the bot.
-
-1. Copy the URL created and go to <https://yoapi.justyo.co>.
-
-1. Sign in using your username and password and go to **Edit Profile**.
-
- ![](/static/images/integrations/yo-app/001.png)
-
-1. Paste the URL in the **Callback** field and click on **Update**.
-
-{!congrats.md!}
-
-![](/static/images/integrations/yo-app/002.png)
-
-Multiple users can use the same Yo bot; each user should use
-their own Zulip account email in the webhook URL.
diff --git a/zerver/webhooks/yo/tests.py b/zerver/webhooks/yo/tests.py
deleted file mode 100644
index d7cc97caaec..00000000000
--- a/zerver/webhooks/yo/tests.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from typing import Dict
-
-from zerver.lib.test_classes import WebhookTestCase
-
-
-class YoHookTests(WebhookTestCase):
- STREAM_NAME = "yo"
- URL_TEMPLATE = "/api/v1/external/yo?api_key={api_key}"
- WEBHOOK_DIR_NAME = "yo"
- VIEW_FUNCTION_NAME = "api_yo_app_webhook"
-
- def test_yo_message(self) -> None:
- """
- Yo sends notification whenever user receives a new Yo from another user.
- """
- cordelia = self.example_user("cordelia")
- self.url = self.build_webhook_url(
- email=cordelia.email,
- username="IAGO",
- user_ip="127.0.0.1",
- )
- expected_message = "Yo from IAGO"
- self.send_and_test_private_message(
- "", expected_message=expected_message, content_type="application/x-www-form-urlencoded"
- )
-
- def get_payload(self, fixture_name: str) -> Dict[str, str]:
- return {}
diff --git a/zerver/webhooks/yo/view.py b/zerver/webhooks/yo/view.py
deleted file mode 100644
index 6556deaab5f..00000000000
--- a/zerver/webhooks/yo/view.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Webhooks for external integrations.
-from typing import Optional
-
-from django.http import HttpRequest, HttpResponse
-
-from zerver.actions.message_send import check_send_private_message
-from zerver.decorator import webhook_view
-from zerver.lib.request import REQ, RequestNotes, has_request_variables
-from zerver.lib.response import json_success
-from zerver.models import UserProfile, get_user
-
-
-@webhook_view("Yo", notify_bot_owner_on_invalid_json=False)
-@has_request_variables
-def api_yo_app_webhook(
- request: HttpRequest,
- user_profile: UserProfile,
- email: str = REQ(default=""),
- username: str = REQ(default="Yo Bot"),
- topic: Optional[str] = REQ(default=None),
- user_ip: Optional[str] = REQ(default=None),
-) -> HttpResponse:
- body = f"Yo from {username}"
- receiving_user = get_user(email, user_profile.realm)
- client = RequestNotes.get_notes(request).client
- assert client is not None
- check_send_private_message(user_profile, client, receiving_user, body)
- return json_success(request)