api: Rename subject_links to topic_links.

Fixes #13588
This commit is contained in:
Vishnu KS 2020-02-07 17:39:17 +05:30 committed by Tim Abbott
parent e9c6653852
commit 4572be8c27
8 changed files with 15 additions and 17 deletions

View File

@ -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,
}]);
});

View File

@ -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) {

View File

@ -42,7 +42,7 @@
],
"recipient_id": 20,
"subject_links": [
"topic_links": [
],
"sender_full_name": "Iago",

View File

@ -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.)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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": [],