mirror of https://github.com/zulip/zulip.git
subject -> topic: Fix create_message_object().
This commit is contained in:
parent
3e860fbc39
commit
82b9f2a3db
|
@ -138,9 +138,9 @@ exports.empty_topic_placeholder = function () {
|
||||||
|
|
||||||
function create_message_object() {
|
function create_message_object() {
|
||||||
// Topics are optional, and we provide a placeholder if one isn't given.
|
// Topics are optional, and we provide a placeholder if one isn't given.
|
||||||
var subject = compose_state.topic();
|
var topic = compose_state.topic();
|
||||||
if (subject === "") {
|
if (topic === "") {
|
||||||
subject = compose.empty_topic_placeholder();
|
topic = compose.empty_topic_placeholder();
|
||||||
}
|
}
|
||||||
|
|
||||||
var content = make_uploads_relative(compose_state.message_content());
|
var content = make_uploads_relative(compose_state.message_content());
|
||||||
|
@ -152,8 +152,8 @@ function create_message_object() {
|
||||||
sender_id: page_params.user_id,
|
sender_id: page_params.user_id,
|
||||||
queue_id: page_params.queue_id,
|
queue_id: page_params.queue_id,
|
||||||
stream: '',
|
stream: '',
|
||||||
subject: '',
|
|
||||||
};
|
};
|
||||||
|
util.set_topic(message, '');
|
||||||
|
|
||||||
if (message.type === "private") {
|
if (message.type === "private") {
|
||||||
// TODO: this should be collapsed with the code in composebox_typeahead.js
|
// TODO: this should be collapsed with the code in composebox_typeahead.js
|
||||||
|
@ -171,7 +171,7 @@ function create_message_object() {
|
||||||
if (sub) {
|
if (sub) {
|
||||||
message.stream_id = sub.stream_id;
|
message.stream_id = sub.stream_id;
|
||||||
}
|
}
|
||||||
message.subject = subject;
|
util.set_topic(message, topic);
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,6 +291,10 @@ exports.get_match_topic = function (obj) {
|
||||||
return obj.match_subject;
|
return obj.match_subject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.set_topic = function (obj, topic) {
|
||||||
|
obj.subject = topic;
|
||||||
|
};
|
||||||
|
|
||||||
return exports;
|
return exports;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in New Issue