mirror of https://github.com/zulip/zulip.git
markdown: Set is_me_message in apply_markdown.
This should make the variable available to things like drafts and previews.
This commit is contained in:
parent
133f005530
commit
e80f93dc42
|
@ -318,7 +318,6 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
|||
var message = {subject: "No links here", raw_content: input};
|
||||
message.flags = ['read'];
|
||||
markdown.apply_markdown(message);
|
||||
markdown.set_is_me_message(message);
|
||||
|
||||
assert.equal(message.is_me_message, true);
|
||||
assert.equal(message.flags.length, 1);
|
||||
|
@ -327,7 +326,6 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
|
|||
input = "testing this @**all** @**Cordelia Lear**";
|
||||
message = {subject: "No links here", raw_content: input};
|
||||
markdown.apply_markdown(message);
|
||||
markdown.set_is_me_message(message);
|
||||
|
||||
assert.equal(message.is_me_message, false);
|
||||
assert.equal(message.flags.length, 1);
|
||||
|
|
|
@ -105,7 +105,6 @@ function insert_local_message(message_request, local_id) {
|
|||
message.local_id = local_id;
|
||||
message.locally_echoed = true;
|
||||
message.id = message.local_id;
|
||||
markdown.set_is_me_message(message);
|
||||
markdown.add_subject_links(message);
|
||||
|
||||
waiting_for_id[message.local_id] = message;
|
||||
|
|
|
@ -74,9 +74,6 @@ exports.apply_markdown = function (message) {
|
|||
},
|
||||
};
|
||||
message.content = marked(message.raw_content + '\n\n', options).trim();
|
||||
};
|
||||
|
||||
exports.set_is_me_message = function (message) {
|
||||
message.is_me_message = (message.raw_content.indexOf('/me ') === 0 &&
|
||||
message.content.indexOf('<p>') === 0 &&
|
||||
message.content.lastIndexOf('</p>') === message.content.length - 4);
|
||||
|
|
Loading…
Reference in New Issue