drafts: Use "topic" internally.

We still have to support "subject" for old drafts,
but we write "topic" for new drafts.
This commit is contained in:
Steve Howell
2018-12-16 16:36:41 +00:00
committed by Tim Abbott
parent 9ba7b4fcbb
commit 9861cdfeb6
3 changed files with 35 additions and 6 deletions

View File

@@ -81,7 +81,7 @@ exports.snapshot_message = function () {
message.private_message_recipient = recipient;
} else {
message.stream = compose_state.stream_name();
message.subject = compose_state.topic();
message.topic = compose_state.topic();
}
return message;
};
@@ -97,7 +97,7 @@ exports.restore_message = function (draft) {
compose_args = {
type: 'stream',
stream: draft.stream,
subject: draft.subject,
subject: util.get_draft_topic(draft),
content: draft.content,
};
@@ -246,8 +246,11 @@ exports.setup_page = function (callback) {
// single space char for proper rendering of the stream label
var space_string = new Handlebars.SafeString(" ");
var stream = draft.stream.length > 0 ? draft.stream : space_string;
var draft_topic = draft.subject.length === 0 ?
compose.empty_topic_placeholder() : draft.subject;
var draft_topic = util.get_draft_topic(draft);
if (draft_topic === '') {
draft_topic = compose.empty_topic_placeholder();
}
formatted = {
draft_id: id,