Fix editing messages by adding or removing leading /me.

Previously, this did not correctly rerender the message to be (or not
to be) rendered as a /me style message.

Fixes: #835.
This commit is contained in:
Tomasz Kolek 2016-06-22 22:14:35 +02:00 committed by Tim Abbott
parent dfd8fede4a
commit e6861636c8
2 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,7 @@ exports.save = function (row, from_topic_edited_only) {
if (new_content !== message.raw_content && !from_topic_edited_only) {
request.content = new_content;
message.is_me_message = new_content.lastIndexOf('/me', 0) === 0;
changed = true;
}
if (!changed) {

View File

@ -2334,6 +2334,9 @@ def update_user_message_flags(message, ums):
update_flag(um, wildcard, UserMessage.flags.wildcard_mentioned)
is_me_message = getattr(message, 'is_me_message', False)
update_flag(um, is_me_message, UserMessage.flags.is_me_message)
for um in changed_ums:
um.save(update_fields=['flags'])