Allow anyone to edit a "no topic" message

This change would allow anyone in the realm to set a topic for a "no topic"
message. As soon as the message topic is set, only the sender can change it again.

(imported from commit 0a91a93b8fd14549965cedc79f45ffd869d82307)
This commit is contained in:
acrefoot
2013-08-16 17:45:13 -04:00
parent e8e5cc37b7
commit 395aaae994
9 changed files with 92 additions and 30 deletions

View File

@@ -963,7 +963,8 @@ def do_update_message(user_profile, message_id, subject, content):
edit_history_event = {}
if message.sender != user_profile:
raise JsonableError("Message was not sent by you")
if not (message.subject == "(no topic)" and content is None):
raise JsonableError("Message was not sent by you")
# Set first_rendered_content to be the oldest version of the
# rendered content recorded; which is the current version if the