mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
subject -> topic: Fix create_message_object().
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user