markdown: Make backend status message detection logic mimic frontend.

In 93914d8cd8, 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.
This commit is contained in:
Rohitt Vashishtha 2019-06-21 11:09:52 +05:30 committed by Tim Abbott
parent 4489df7cd6
commit c03efd2971
2 changed files with 2 additions and 2 deletions

View File

@ -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('<p>') and rendered_content.endswith('</p>'):
return True
return False

View File

@ -958,7 +958,7 @@ class BugdownTest(ZulipTestCase):
rendered_content,
'<p>/me writes a second line<br>\nline</p>'
)
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')