Skip to content

Commit

Permalink
Fix editing messages by adding or removing leading /me.
Browse files Browse the repository at this point in the history
Previously, this did not correctly rerender the message to be (or not
to be) rendered as a /me style message.

Fixes: zulip#835.
  • Loading branch information
Tomasz Kolek authored and timabbott committed Jun 24, 2016
1 parent dfd8fed commit e686163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions static/js/message_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions zerver/lib/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,9 @@ def update_flag(um, should_set, flag):

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'])

Expand Down

0 comments on commit e686163

Please sign in to comment.