From 4572be8c278c4404aa48f65acd79a277d6443de2 Mon Sep 17 00:00:00 2001 From: Vishnu KS Date: Fri, 7 Feb 2020 17:39:17 +0530 Subject: [PATCH] api: Rename subject_links to topic_links. Fixes #13588 --- frontend_tests/node_tests/echo.js | 6 +++--- static/js/util.js | 6 ++---- templates/zerver/api/fixtures.json | 2 +- templates/zerver/api/get-messages.md | 2 +- tools/zulip-export/zulip-export | 2 +- zerver/lib/topic.py | 2 +- zerver/openapi/zulip-2.0.yaml | 4 ++-- zerver/openapi/zulip.yaml | 8 ++++---- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/frontend_tests/node_tests/echo.js b/frontend_tests/node_tests/echo.js index 619d371e7d..79f928a6fb 100644 --- a/frontend_tests/node_tests/echo.js +++ b/frontend_tests/node_tests/echo.js @@ -62,7 +62,7 @@ run_test('process_from_server for differently rendered messages', () => { timestamp: old_value, is_me_message: old_value, submessages: old_value, - subject_links: old_value, + topic_links: old_value, }, }; const server_messages = [ @@ -72,7 +72,7 @@ run_test('process_from_server for differently rendered messages', () => { timestamp: new_value, is_me_message: new_value, submessages: new_value, - subject_links: new_value, + topic_links: new_value, }, ]; echo._patch_waiting_for_awk(waiting_for_ack); @@ -86,7 +86,7 @@ run_test('process_from_server for differently rendered messages', () => { timestamp: new_value, is_me_message: new_value, submessages: new_value, - subject_links: new_value, + topic_links: new_value, }]); }); diff --git a/static/js/util.js b/static/js/util.js index 27ba80d5b5..e84f227603 100644 --- a/static/js/util.js +++ b/static/js/util.js @@ -259,13 +259,11 @@ exports.sorted_ids = function (ids) { }; exports.set_topic_links = function (obj, topic_links) { - // subject_links is a legacy name - obj.subject_links = topic_links; + obj.topic_links = topic_links; }; exports.get_topic_links = function (obj) { - // subject_links is a legacy name - return obj.subject_links; + return obj.topic_links; }; exports.set_match_data = function (target, source) { diff --git a/templates/zerver/api/fixtures.json b/templates/zerver/api/fixtures.json index 78f008d4f8..84346a2f06 100644 --- a/templates/zerver/api/fixtures.json +++ b/templates/zerver/api/fixtures.json @@ -42,7 +42,7 @@ ], "recipient_id": 20, - "subject_links": [ + "topic_links": [ ], "sender_full_name": "Iago", diff --git a/templates/zerver/api/get-messages.md b/templates/zerver/api/get-messages.md index f5dfacd05d..88d94b5826 100644 --- a/templates/zerver/api/get-messages.md +++ b/templates/zerver/api/get-messages.md @@ -116,7 +116,7 @@ present in all Zulip API responses). * `subject`: The `topic` of the message (only present for stream messages). The name is a legacy holdover from when topics were called "subjects". - * `subject_links`: Data on any links to be included in the `topic` + * `topic_links`: Data on any links to be included in the `topic` line (these are generated by [custom linkification filters][linkification-filters] that match content in the message's topic.) diff --git a/tools/zulip-export/zulip-export b/tools/zulip-export/zulip-export index feb79524b3..7cf49ee13e 100755 --- a/tools/zulip-export/zulip-export +++ b/tools/zulip-export/zulip-export @@ -76,7 +76,7 @@ for msg in result['messages']: if msg['type'] != 'stream': continue # Remove extraneous metadata - for k in ['flags', 'edit_history', 'subject_links', + for k in ['flags', 'edit_history', 'topic_links', 'avatar_url', 'recipient_id', 'sender_short_name', 'content_type', 'client', 'sender_realm_str', 'id', 'type']: msg.pop(k, None) diff --git a/zerver/lib/topic.py b/zerver/lib/topic.py index 1f4ffcf56a..e2928e9131 100644 --- a/zerver/lib/topic.py +++ b/zerver/lib/topic.py @@ -23,7 +23,7 @@ from typing import Any, Dict, List, Optional, Tuple # Only use these constants for events. ORIG_TOPIC = "orig_subject" TOPIC_NAME = "subject" -TOPIC_LINKS = "subject_links" +TOPIC_LINKS = "topic_links" MATCH_TOPIC = "match_subject" # This constant is actually embedded into diff --git a/zerver/openapi/zulip-2.0.yaml b/zerver/openapi/zulip-2.0.yaml index 0acde475b4..ef362a6f77 100644 --- a/zerver/openapi/zulip-2.0.yaml +++ b/zerver/openapi/zulip-2.0.yaml @@ -503,7 +503,7 @@ definitions: - avatar_url - flags - sender_email - - subject_links + - topic_links - sender_realm_str - subject - type @@ -546,7 +546,7 @@ definitions: type: string sender_email: type: string - subject_links: + topic_links: type: array items: type: string diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index ca91634858..84b7e2eac0 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -115,7 +115,7 @@ paths: "sender_realm_str": "example", "sender_short_name": "othello-bot", "topic": "Castle", - "subject_links": [], + "topic_links": [], "timestamp": 1375978403, "type": "stream" }, @@ -144,7 +144,7 @@ paths: "sender_realm_str": "example", "sender_short_name": "othello-bot", "subject": "", - "subject_links": [], + "topic_links": [], "timestamp": 1375978404, "type": "private" }, @@ -436,7 +436,7 @@ paths: "sender_id": 4, "sender_full_name": "King Hamlet", "recipient_id": 27, - "subject_links": [], + "topic_links": [], "client": "populate_db", "avatar_url": "https://secure.gravatar.com/avatar/6d8cad0fd00256e7b40691d27ddfd466?d=identicon&version=1", "submessages": [], @@ -461,7 +461,7 @@ paths: "sender_id": 4, "sender_full_name": "King Hamlet", "recipient_id": 20, - "subject_links": [], + "topic_links": [], "client": "populate_db", "avatar_url": "https://secure.gravatar.com/avatar/6d8cad0fd00256e7b40691d27ddfd466?d=identicon&version=1", "submessages": [],