reload: Use "topic" to encode compose topic.

This commit is contained in:
Steve Howell
2018-12-16 17:02:16 +00:00
committed by Tim Abbott
parent 9861cdfeb6
commit 057ee6633a
3 changed files with 16 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ function preserve_state(send_after_reload, save_pointer, save_narrow, save_compo
if (msg_type === 'stream') {
url += "+msg_type=stream";
url += "+stream=" + encodeURIComponent(compose_state.stream_name());
url += "+subject=" + encodeURIComponent(compose_state.topic());
url += "+topic=" + encodeURIComponent(compose_state.topic());
} else if (msg_type === 'private') {
url += "+msg_type=private";
url += "+recipient=" + encodeURIComponent(compose_state.recipient());
@@ -131,8 +131,10 @@ exports.initialize = function () {
try {
// TODO: preserve focus
var topic = util.get_reload_topic(vars);
compose_actions.start(vars.msg_type, {stream: vars.stream || '',
subject: vars.subject || '',
subject: topic || '',
private_message_recipient: vars.recipient || '',
content: vars.msg || ''});
if (send_now) {

View File

@@ -296,6 +296,13 @@ exports.get_draft_topic = function (obj) {
return obj.topic || obj.subject || '';
};
exports.get_reload_topic = function (obj) {
// When we first upgrade to releases that have
// topic=foo in the code, the user's reload URL
// may still have subject=foo from the prior version.
return obj.topic || obj.subject || '';
};
exports.set_topic = function (obj, topic) {
obj.subject = topic;
};