subject -> topic: Fix create_message_object().

This commit is contained in:
Steve Howell 2018-11-15 17:34:16 +00:00 committed by Tim Abbott
parent 3e860fbc39
commit 82b9f2a3db
2 changed files with 9 additions and 5 deletions

View File

@ -138,9 +138,9 @@ exports.empty_topic_placeholder = function () {
function create_message_object() {
// Topics are optional, and we provide a placeholder if one isn't given.
var subject = compose_state.topic();
if (subject === "") {
subject = compose.empty_topic_placeholder();
var topic = compose_state.topic();
if (topic === "") {
topic = compose.empty_topic_placeholder();
}
var content = make_uploads_relative(compose_state.message_content());
@ -152,8 +152,8 @@ function create_message_object() {
sender_id: page_params.user_id,
queue_id: page_params.queue_id,
stream: '',
subject: '',
};
util.set_topic(message, '');
if (message.type === "private") {
// TODO: this should be collapsed with the code in composebox_typeahead.js
@ -171,7 +171,7 @@ function create_message_object() {
if (sub) {
message.stream_id = sub.stream_id;
}
message.subject = subject;
util.set_topic(message, topic);
}
return message;
}

View File

@ -291,6 +291,10 @@ exports.get_match_topic = function (obj) {
return obj.match_subject;
};
exports.set_topic = function (obj, topic) {
obj.subject = topic;
};
return exports;
}());