Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
bots: Rename is_cross_realm_bot API field to is_system_bot.
Mateusz Mandera119f1da04afb
diff --git a/static/js/popovers.js b/static/js/popovers.jsindex 41940a239ce..904fd6da232 100644--- a/static/js/popovers.js+++ b/static/js/popovers.js@@ -233,10 +233,10 @@ function render_user_info_popover(};if (user.is_bot) {- const is_cross_realm_bot = user.is_cross_realm_bot;+ const is_system_bot = user.is_system_bot;const bot_owner_id = user.bot_owner_id;- if (is_cross_realm_bot) {- args.is_cross_realm_bot = is_cross_realm_bot;+ if (is_system_bot) {+ args.is_system_bot = is_system_bot;} else if (bot_owner_id) {const bot_owner = people.get_by_user_id(bot_owner_id);args.bot_owner = bot_owner;diff --git a/static/templates/user_info_popover_content.hbs b/static/templates/user_info_popover_content.hbsindex d9b84542225..34f58d1aeef 100644--- a/static/templates/user_info_popover_content.hbs+++ b/static/templates/user_info_popover_content.hbs@@ -40,7 +40,7 @@</span></li>{{else}}- {{#if is_cross_realm_bot}}+ {{#if is_system_bot}}<li>{{#tr}}System bot{{/tr}}</li>{{else}}<li>{{#tr}}Bot{{/tr}}</li>diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.mdindex f9dbe5315a1..775f599a7f0 100644--- a/templates/zerver/api/changelog.md+++ b/templates/zerver/api/changelog.md@@ -11,6 +11,12 @@ below features are supported.## Changes in Zulip 5.0+**Feature level 83**++* * [`POST /register`](/api/register-queue): The `cross_realm_bots`+ section of the response now uses the `is_system_bot` flag to+ indicate whether the bot is a system bot.+**Feature level 82*** [`PATCH /settings`](/api/update-settings) now accepts a newdiff --git a/version.py b/version.pyindex edff8dfff2e..2d377f78bcc 100644--- a/version.py+++ b/version.py@@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3"# Changes should be accompanied by documentation explaining what the# new level means in templates/zerver/api/changelog.md, as well as# "**Changes**" entries in the endpoint's documentation in `zulip.yaml`.-API_FEATURE_LEVEL = 82+API_FEATURE_LEVEL = 83# Bump the minor PROVISION_VERSION to indicate that folks should provision# only when going from an old version of the code to a newer version. Bumpdiff --git a/zerver/lib/users.py b/zerver/lib/users.pyindex 27d7579baa4..bc6f8194ccb 100644--- a/zerver/lib/users.py+++ b/zerver/lib/users.py@@ -429,7 +429,7 @@ def format_user_row(if is_bot:result["bot_type"] = row["bot_type"]if row["email"] in settings.CROSS_REALM_BOT_EMAILS:- result["is_cross_realm_bot"] = True+ result["is_system_bot"] = True# Note that bot_owner_id can be None with legacy data.result["bot_owner_id"] = row["bot_owner_id"]diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex 6e72287376d..4c1f728660a 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -9656,10 +9656,15 @@ paths:date_joined: {}delivery_email: {}profile_data: {}- is_cross_realm_bot:+ is_system_bot:type: booleandescription: |- Whether the user is a cross realm bot.+ Whether the user is a system bot. System bots are special+ bot user accounts that are managed by the system, rather than+ the organization's administrators.++ **Changes**: This field was called `is_cross_realm_bot`+ before Zulip 5.0 (feature level 83).example:{"last_event_id": -1,diff --git a/zerver/tests/test_event_system.py b/zerver/tests/test_event_system.pyindex 732400e106e..e99a42def33 100644--- a/zerver/tests/test_event_system.py+++ b/zerver/tests/test_event_system.py@@ -1120,7 +1120,7 @@ class TestGetRawUserDataSystemBotRealm(ZulipTestCase):for bot_email in settings.CROSS_REALM_BOT_EMAILS:bot_profile = get_system_bot(bot_email)self.assertTrue(bot_profile.id in result)- self.assertTrue(result[bot_profile.id]["is_cross_realm_bot"])+ self.assertTrue(result[bot_profile.id]["is_system_bot"])class TestUserPresenceUpdatesDisabled(ZulipTestCase):diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.pyindex c4e89dfec2e..5bb9ae20d3a 100644--- a/zerver/tests/test_home.py+++ b/zerver/tests/test_home.py@@ -628,7 +628,7 @@ class HomeTest(ZulipTestCase):is_owner=False,is_billing_admin=False,role=email_gateway_bot.role,- is_cross_realm_bot=True,+ is_system_bot=True,is_guest=False,),dict(@@ -644,7 +644,7 @@ class HomeTest(ZulipTestCase):is_owner=False,is_billing_admin=False,role=notification_bot.role,- is_cross_realm_bot=True,+ is_system_bot=True,is_guest=False,),dict(@@ -660,7 +660,7 @@ class HomeTest(ZulipTestCase):is_owner=False,is_billing_admin=False,role=welcome_bot.role,- is_cross_realm_bot=True,+ is_system_bot=True,is_guest=False,),],