From c03efd297100ecdfa1a4a041f7dea28d7b5fb052 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Fri, 21 Jun 2019 11:09:52 +0530 Subject: [PATCH] markdown: Make backend status message detection logic mimic frontend. In 93914d8cd8778106b62ff0d7762882ba0444f304, we intended to change our markdown processor to add support for multi-line /me messages. However, we neglected to change the backend processor, resulting in the change only taking effect for the user sending the message :(. We fix this by changing the backend processor too. Fixes #12450. --- zerver/models.py | 2 +- zerver/tests/test_bugdown.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/models.py b/zerver/models.py index 6a87accb02..3abdb9a65f 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -1637,7 +1637,7 @@ class Message(AbstractMessage): """ Returns True if content and rendered_content are from 'me_message' """ - if content.startswith('/me ') and '\n' not in content: + if content.startswith('/me '): if rendered_content.startswith('

') and rendered_content.endswith('

'): return True return False diff --git a/zerver/tests/test_bugdown.py b/zerver/tests/test_bugdown.py index 6faac7b3a6..43953ae704 100644 --- a/zerver/tests/test_bugdown.py +++ b/zerver/tests/test_bugdown.py @@ -958,7 +958,7 @@ class BugdownTest(ZulipTestCase): rendered_content, '

/me writes a second line
\nline

' ) - self.assertFalse(Message.is_status_message(content, rendered_content)) + self.assertTrue(Message.is_status_message(content, rendered_content)) def test_alert_words(self) -> None: user_profile = self.example_user('othello')